From 87027dae8d656d10ee245ab97a55e64ed6644145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 27 Dec 2025 14:59:52 +0100 Subject: [PATCH] gh-142664: fix `PyObject_Hash` invokation post GH-143217 --- Objects/memoryobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index f50de3e4c64071..f3b7e4a396b4a1 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -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; }