8000 bpo-40521: Fix PyUnicode_InternInPlace() (GH-22376) · xzy3/cpython@596e658 · GitHub 10000
[go: up one dir, main page]

Skip to content

Commit 596e658

Browse files
vstinnerSeth Sims
authored andcommitted
bpo-40521: Fix PyUnicode_InternInPlace() (pythonGH-22376)
Fix PyUnicode_InternInPlace() when the INTERNED_STRINGS macro is not defined (when the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is defined).
1 parent f76fee0 commit 596e658

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/unicodeobject.c

Lines changed: 4 additions & 0 deletions
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)
0