mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-142664: fix PyObject_Hash invokation post GH-143217 (#143223)
This commit is contained in:
parent
3a728e5f93
commit
84fcdbd86e
1 changed files with 2 additions and 2 deletions
|
|
@ -3235,9 +3235,9 @@ memory_hash(PyObject *_self)
|
|||
// Prevent 'self' from being freed when computing the item's hash.
|
||||
// See https://github.com/python/cpython/issues/142664.
|
||||
self->exports++;
|
||||
int rc = PyObject_Hash(view->obj);
|
||||
Py_hash_t h = PyObject_Hash(view->obj);
|
||||
self->exports--;
|
||||
if (rc == -1) {
|
||||
if (h == -1) {
|
||||
/* Keep the original error message */
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue