Make _ast module state per-interpreter when building CPython core · python/cpython@60960cb · GitHub
Skip to content

Commit 60960cb

Browse files
committed
Make _ast module state per-interpreter when building CPython core
- For Py_BUILD_CORE, the interpreter state now contains a lazily initialized pointer to _ast module state, which is cleared through _PyAST_Fini. - Elsewhere (for extension modules created by e.g. pegen tests), the state is process-global (static). To prevent issues, such an _ast module can only be loaded once per process. See PEP 630 for background info.
1 parent 4a2b65a commit 60960cb

3 files changed

Lines changed: 149 additions & 12 deletions

File tree

Include/internal/pycore_interp.h

Lines changed: 3 additions & 0 deletions

Parser/asdl_c.py

Lines changed: 73 additions & 6 deletions

Python/Python-ast.c

Lines changed: 73 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)