From b3a0d15e3bfa7ae49a4a8b09fc0cee880ffd2946 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sat, 27 Dec 2025 15:53:13 +0100 Subject: [PATCH] [3.13] gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223) (#143225) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223) (cherry picked from commit 84fcdbd86ecd81f7cc793e22268a029ac6cf29c2) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Objects/memoryobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index f71ac6fde17d..8dc53c9ccbba 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -3078,9 +3078,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; } -- 2.47.3