https://github.com/python/cpython/commit/bbe9ed95d48ee37645a5609f85d47bcfa95aa7ee
commit: bbe9ed95d48ee37645a5609f85d47bcfa95aa7ee
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: picnixz <[email protected]>
date: 2025-12-27T14:55:45Z
summary:

[3.14] gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223) 
(#143224)

gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223)
(cherry picked from commit 84fcdbd86ecd81f7cc793e22268a029ac6cf29c2)

Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Objects/memoryobject.c

diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index e78f5d110a457f..2d6c33b2ac1cde 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -3232,9 +3232,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;
             }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to