summaryrefslogtreecommitdiff
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index b57aca377b..31c38e8a80 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -263,6 +263,10 @@ void _PyAST_Fini(PyInterpreterState *interp)
Py_CLEAR(state->vararg);
Py_CLEAR(state->withitem_type);
+ if (_PyInterpreterState_Get() == _PyInterpreterState_Main()) {
+ Py_CLEAR(_Py_CACHED_OBJECT(str_replace_inf));
+ }
+
#if !defined(NDEBUG)
state->initialized = -1;
#else