Skip to content

Commit

Permalink
sys_set_object() ignores removed value
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Nov 13, 2023
1 parent 4ff464f commit 4dd668c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v)
}
PyObject *sd = interp->sysdict;
if (v == NULL) {
if (PyDict_Pop(sd, key, &v) < 0) {
if (PyDict_Pop(sd, key, NULL) < 0) {
return -1;
}
Py_XDECREF(v);
return 0;
}
else {
Expand Down

0 comments on commit 4dd668c

Please sign in to comment.