diff options
author | Paul Melis <p.e.c.melis@alumnus.utwente.nl> | 2021-11-16 06:47:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 14:47:40 +0900 |
commit | 09187421eb0ac7061de83c9c112d738aa1edd2cf (patch) | |
tree | b69c73506a455542fada42fdd444d525734411bf | |
parent | 38dba9634e4efa7886a777b9e7c739dc148da457 (diff) | |
download | msgpack-python-09187421eb0ac7061de83c9c112d738aa1edd2cf.tar.gz |
Improve exception message relating to strict_map_key (#485)
-rw-r--r-- | msgpack/unpack.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index 34212bc..23aa622 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -193,7 +193,7 @@ static inline int unpack_callback_map(unpack_user* u, unsigned int n, msgpack_un 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) { if (u->strict_map_key && !PyUnicode_CheckExact(k) && !PyBytes_CheckExact(k)) { - PyErr_Format(PyExc_ValueError, "%.100s is not allowed for map key", Py_TYPE(k)->tp_name); + PyErr_Format(PyExc_ValueError, "%.100s is not allowed for map key when strict_map_key=True", Py_TYPE(k)->tp_name); return -1; } if (PyUnicode_CheckExact(k)) { |