]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142664: fix `PyObject_Hash` invokation post GH-143217 (#143223)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sat, 27 Dec 2025 14:30:09 +0000 (14:30 +0000)
committerGitHub <noreply@github.com>
Sat, 27 Dec 2025 14:30:09 +0000 (14:30 +0000)
Objects/memoryobject.c

index f50de3e4c64071ac210392f8275060320c296c40..f3b7e4a396b4a1015deda830fe83d7d2d203f764 100644 (file)
@@ -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;
             }