Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annoying DeprecationWarning in constructor.py #220

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib3/yaml/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .error import *
from .nodes import *

import collections, datetime, base64, binascii, re, sys, types
import collections.abc, datetime, base64, binascii, re, sys, types

class ConstructorError(MarkedYAMLError):
pass
Expand Down Expand Up @@ -123,7 +123,7 @@ def construct_mapping(self, node, deep=False):
mapping = {}
for key_node, value_node in node.value:
key = self.construct_object(key_node, deep=deep)
if not isinstance(key, collections.Hashable):
if not isinstance(key, collections.abc.Hashable):
raise ConstructorError("while constructing a mapping", node.start_mark,
"found unhashable key", key_node.start_mark)
value = self.construct_object(value_node, deep=deep)
Expand Down