summaryrefslogtreecommitdiffstats
path: root/Modules/_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index 53e1e88..94a7c0d 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -746,12 +746,15 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
key = scanstring_unicode(pystr, idx + 1, s->strict, &next_idx);
if (key == NULL)
goto bail;
- memokey = PyDict_GetItem(s->memo, key);
+ memokey = PyDict_GetItemWithError(s->memo, key);
if (memokey != NULL) {
Py_INCREF(memokey);
Py_DECREF(key);
key = memokey;
}
+ else if (PyErr_Occurred()) {
+ goto bail;
+ }
else {
if (PyDict_SetItem(s->memo, key, key) < 0)
goto bail;