Skip to content

Commit

Permalink
bpo-40521: Fix PyUnicode_InternInPlace() (GH-22376)
Browse files Browse the repository at this point in the history
Fix PyUnicode_InternInPlace() when the INTERNED_STRINGS macro is not
defined (when the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro is
defined).
  • Loading branch information
vstinner authored Sep 23, 2020
1 parent 19c3ac9 commit 7f413a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -15754,6 +15754,10 @@ PyUnicode_InternInPlace(PyObject **p)
this. */
Py_SET_REFCNT(s, Py_REFCNT(s) - 2);
_PyUnicode_STATE(s).interned = SSTATE_INTERNED_MORTAL;
#else
// PyDict expects that interned strings have their hash
// (PyASCIIObject.hash) already computed.
(void)unicode_hash(s);
#endif
}

Expand Down

0 comments on commit 7f413a5

Please sign in to comment.