summaryrefslogtreecommitdiffstats
path: root/Objects/descrobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r--Objects/descrobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 40629f6..a2ecde5 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -91,9 +91,9 @@ wrapper_repr(PyWrapperDescrObject *descr)
static int
descr_check(PyDescrObject *descr, PyObject *obj, PyTypeObject *type,
- PyObject **pres)
+ PyObject **pres)
{
- if (obj == NULL || obj == Py_None) {
+ if (obj == NULL || (obj == Py_None && type != Py_None->ob_type)) {
Py_INCREF(descr);
*pres = (PyObject *)descr;
return 1;