8000 [3.9] bpo-41194: The _ast module cannot be loaded more than once (GH-21290) by vstinner · Pull Request #21292 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.9] bpo-41194: The _ast module cannot be loaded more than once (GH-21290) #21292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2020
Merged

Conversation

vstinner
Copy link
Member
@vstinner vstinner commented Jul 3, 2020

vstinner added 2 commits July 3, 2020 14:16
Rework asdl_c.py to pass the module state to functions in
Python-ast.c, instead of using astmodulestate_global.

Handle also PyState_AddModule() failure in init_types().

(cherry picked from commit 74419f0)
Fix a crash in the _ast module: it can no longer be loaded more than
once. It now uses a global state rather than a module state.

* Move _ast module state: use a global state instead.
* Set _astmodule.m_size to -1, so the extension cannot be loaded more
  than once.

(cherry picked from commit 91e1bc1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0