summaryrefslogtreecommitdiff
path: root/Objects/classobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index cd0bb1d9d8..f1dabfef5b 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -864,10 +864,7 @@ instance_hash(inst)
func = instance_getattr(inst, cmpstr);
if (func == NULL) {
PyErr_Clear();
- outcome = (long)inst;
- if (outcome == -1)
- outcome = -2;
- return outcome;
+ return _Py_HashPointer(inst);
}
PyErr_SetString(PyExc_TypeError, "unhashable instance");
return -1;