summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index e2852328..c17de44 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -125,11 +125,9 @@ sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v)
}
PyObject *sd = interp->sysdict;
if (v == NULL) {
- v = _PyDict_Pop(sd, key, Py_None);
- if (v == NULL) {
+ if (PyDict_Pop(sd, key, NULL) < 0) {
return -1;
}
- Py_DECREF(v);
return 0;
}
else {