mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-20 04:13:16 +00:00
parent
e419cd8e2d
commit
2c6668941f
2 changed files with 5 additions and 0 deletions
|
@ -644,6 +644,8 @@ class Unpacker(object):
|
|||
key = self._unpack(EX_CONSTRUCT)
|
||||
if self._strict_map_key and type(key) not in (unicode, bytes):
|
||||
raise ValueError("%s is not allowed for map key" % str(type(key)))
|
||||
if not PY2 and type(key) is str:
|
||||
key = sys.intern(key)
|
||||
ret[key] = self._unpack(EX_CONSTRUCT)
|
||||
if self._object_hook is not None:
|
||||
ret = self._object_hook(ret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue