Skip to content

Commit 887f102

Browse files
else if
1 parent 30b0c6c commit 887f102

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

msgpack/fallback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def _unpack(self, execute=EX_CONSTRUCT):
529529
raise ValueError("%s is not allowed for map key" % str(type(key)))
530530
if isinstance(key, str):
531531
key = sys.intern(key)
532-
if isinstance(key, list):
532+
elif isinstance(key, list):
533533
key = tuple(key)
534534
ret[key] = self._unpack(EX_CONSTRUCT)
535535
if self._object_hook is not None:

msgpack/unpack.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ static inline int unpack_callback_map_item(unpack_user* u, unsigned int current,
198198
}
199199
if (PyUnicode_CheckExact(k)) {
200200
PyUnicode_InternInPlace(&k);
201-
}
202-
if (PyList_CheckExact(k)) {
201+
} else if (PyList_CheckExact(k)) {
203202
Py_ssize_t list_size = PyList_Size(k);
204203
PyObject* tuple = PyTuple_New(list_size);
205204

0 commit comments

Comments
 (0)