Skip to content

Commit 7f413a5

Browse files
authored
bpo-40521: Fix PyUnicode_InternInPlace() (GH-22376)
Fix PyUnicode_InternInPlace() when the INTERNED_STRINGS macro is not defined (when the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined).
1 parent 19c3ac9 commit 7f413a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/unicodeobject.c

+4
Original file line numberDiff line numberDiff line change
@@ -15754,6 +15754,10 @@ PyUnicode_InternInPlace(PyObject **p)
1575415754
this. */
1575515755
Py_SET_REFCNT(s, Py_REFCNT(s) - 2);
1575615756
_PyUnicode_STATE(s).interned = SSTATE_INTERNED_MORTAL;
15757+
#else
15758+
// PyDict expects that interned strings have their hash
15759+
// (PyASCIIObject.hash) already computed.
15760+
(void)unicode_hash(s);
1575715761
#endif
1575815762
}
1575915763

0 commit comments

Comments
 (0)