diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/descrobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index a9ee2a4..c29dd83 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -906,7 +906,10 @@ getset_descr_set(PyObject *self, PyObject *obj, PyObject *value) PyErr_SetString(PyExc_AttributeError, "unsettable attribute"); return -1; } - res = PyObject_CallFunction(gs->set, "(OO)", obj, value); + if (value == NULL) + res = PyObject_CallFunction(gs->set, "(O)", obj); + else + res = PyObject_CallFunction(gs->set, "(OO)", obj, value); if (res == NULL) return -1; Py_DECREF(res); |