This commit is contained in:
Jens Jorgensen 2025-05-14 19:23:26 -05:00
parent 30b0c6c507
commit 887f102a7b
2 changed files with 2 additions and 3 deletions

View file

@ -529,7 +529,7 @@ class Unpacker:
raise ValueError("%s is not allowed for map key" % str(type(key)))
if isinstance(key, str):
key = sys.intern(key)
if isinstance(key, list):
elif isinstance(key, list):
key = tuple(key)
ret[key] = self._unpack(EX_CONSTRUCT)
if self._object_hook is not None:

View file

@ -198,8 +198,7 @@ static inline int unpack_callback_map_item(unpack_user* u, unsigned int current,
}
if (PyUnicode_CheckExact(k)) {
PyUnicode_InternInPlace(&k);
}
if (PyList_CheckExact(k)) {
} else if (PyList_CheckExact(k)) {
Py_ssize_t list_size = PyList_Size(k);
PyObject* tuple = PyTuple_New(list_size);