Skip to content

Commit

Permalink
Making python 3.7 + compatible
Browse files Browse the repository at this point in the history
Python warning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  • Loading branch information
Keyrat06 authored Aug 16, 2018
1 parent a9c28e0 commit f92d859
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib3/yaml/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from .error import *
from .nodes import *

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

class ConstructorError(MarkedYAMLError):
pass
Expand Down Expand Up @@ -123,7 +124,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, 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

0 comments on commit f92d859

Please sign in to comment.