From 78cd5c3654036cee2618bece131b2babbb368d69 Mon Sep 17 00:00:00 2001 From: Rishi Raj Date: Mon, 21 Sep 2026 16:09:26 +0530 Subject: [PATCH] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() _Py_hashtable_set() returns -1 on failure, so the "< -1" check could never be true and the Py_FatalError() call was unreachable. --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index da9f8dcc223fc0d..fc137055deb5e5b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -14588,7 +14588,7 @@ intern_static(PyInterpreterState *interp, PyObject *s /* stolen */) return Py_NewRef(r); } - if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < -1) { + if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < 0) { Py_FatalError("failed to intern static string"); }