comparison piecrust/configuration.py @ 1167:c0c00dc1eac7

core: Remove deprecation warning about collections.abc.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 04 Oct 2019 10:07:38 -0700
parents 7e51d14097cb
children
comparison
equal deleted inserted replaced
1166:d8167cbee2f5 1167:c0c00dc1eac7
266 "expected a mapping node, but found %s" % node.id, 266 "expected a mapping node, but found %s" % node.id,
267 node.start_mark) 267 node.start_mark)
268 mapping = collections.OrderedDict() 268 mapping = collections.OrderedDict()
269 for key_node, value_node in node.value: 269 for key_node, value_node in node.value:
270 key = self.construct_object(key_node, deep=deep) 270 key = self.construct_object(key_node, deep=deep)
271 if not isinstance(key, collections.Hashable): 271 if not isinstance(key, collections.abc.Hashable):
272 raise ConstructorError( 272 raise ConstructorError(
273 "while constructing a mapping", node.start_mark, 273 "while constructing a mapping", node.start_mark,
274 "found unhashable key", key_node.start_mark) 274 "found unhashable key", key_node.start_mark)
275 value = self.construct_object(value_node, deep=deep) 275 value = self.construct_object(value_node, deep=deep)
276 mapping[key] = value 276 mapping[key] = value