diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_json.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_json.c b/Modules/_json.c index 6879ad3..fa8e2a9 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -1319,9 +1319,10 @@ encoder_encode_float(PyEncoderObject *s, PyObject *obj) double i = PyFloat_AS_DOUBLE(obj); if (!Py_IS_FINITE(i)) { if (!s->allow_nan) { - PyErr_SetString( + PyErr_Format( PyExc_ValueError, - "Out of range float values are not JSON compliant" + "Out of range float values are not JSON compliant: %R", + obj ); return NULL; } |