diff options
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index c545b90..334be75 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1712,7 +1712,9 @@ property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del) if (new == NULL) return NULL; - Py_XSETREF(((propertyobject *) new)->prop_name, Py_XNewRef(pold->prop_name)); + if (PyObject_TypeCheck((new), &PyProperty_Type)) { + Py_XSETREF(((propertyobject *) new)->prop_name, Py_XNewRef(pold->prop_name)); + } return new; } |