Skip to content

Commit 0918742

Browse files
authored
Improve exception message relating to strict_map_key (#485)
1 parent 38dba96 commit 0918742

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack/unpack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static inline int unpack_callback_map(unpack_user* u, unsigned int n, msgpack_un
193193
static inline int unpack_callback_map_item(unpack_user* u, unsigned int current, msgpack_unpack_object* c, msgpack_unpack_object k, msgpack_unpack_object v)
194194
{
195195
if (u->strict_map_key && !PyUnicode_CheckExact(k) && !PyBytes_CheckExact(k)) {
196-
PyErr_Format(PyExc_ValueError, "%.100s is not allowed for map key", Py_TYPE(k)->tp_name);
196+
PyErr_Format(PyExc_ValueError, "%.100s is not allowed for map key when strict_map_key=True", Py_TYPE(k)->tp_name);
197197
return -1;
198198
}
199199
if (PyUnicode_CheckExact(k)) {

0 commit comments

Comments
 (0)