summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-02-28 21:16:39 (GMT)
committerGitHub <noreply@github.com>2023-02-28 21:16:39 (GMT)
commit880437d4ec65ef35d505eeaff9dad5c6654dbc1a (patch)
tree1dee8a4dcc709b6b9f99d025cddbe3fe14ceadd5 /Parser
parentf300a1fa4c121f7807cbda4fc8bb26240c69ea74 (diff)
downloadcpython-880437d4ec65ef35d505eeaff9dad5c6654dbc1a.zip
cpython-880437d4ec65ef35d505eeaff9dad5c6654dbc1a.tar.gz
cpython-880437d4ec65ef35d505eeaff9dad5c6654dbc1a.tar.bz2
gh-100227: Move _str_replace_inf to PyInterpreterState (gh-102333)
https://github.com/python/cpython/issues/100227
Diffstat (limited to 'Parser')
-rwxr-xr-xParser/asdl_c.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index db0e597..b44e303 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -1484,9 +1484,7 @@ def generate_ast_fini(module_state, f):
for s in module_state:
f.write(" Py_CLEAR(state->" + s + ');\n')
f.write(textwrap.dedent("""
- if (_PyInterpreterState_Get() == _PyInterpreterState_Main()) {
- Py_CLEAR(_Py_CACHED_OBJECT(str_replace_inf));
- }
+ Py_CLEAR(_Py_INTERP_CACHED_OBJECT(interp, str_replace_inf));
#if !defined(NDEBUG)
state->initialized = -1;