mirror of https://github.com/python/cpython
Fix leak in classobject.c. The leak surfaced on the error exit when
hashing a class that does not define __hash__ but does define a comparison.
This commit is contained in:
parent
2d72b5d707
commit
a9e14b7015
|
@ -953,6 +953,7 @@ instance_hash(PyInstanceObject *inst)
|
|||
return _Py_HashPointer(inst);
|
||||
}
|
||||
}
|
||||
Py_XDECREF(func);
|
||||
PyErr_SetString(PyExc_TypeError, "unhashable instance");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue