From 9df9a92a20fc1cbec1eb1b29dc2abc6b9908a813 Mon Sep 17 00:00:00 2001 From: Diego Pomares Date: Wed, 17 Oct 2018 10:40:11 +0200 Subject: [PATCH] Fix annoying DeprecationWarning in constructor.py --- lib3/yaml/constructor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib3/yaml/constructor.py b/lib3/yaml/constructor.py index 981543ae..193d91d9 100644 --- a/lib3/yaml/constructor.py +++ b/lib3/yaml/constructor.py @@ -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 @@ -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)