bpo-41194: Convert _ast extension to PEP 489 by vstinner · Pull Request #21293 · python/cpython · GitHub
Skip to content

bpo-41194: Convert _ast extension to PEP 489 - #21293

Merged
vstinner merged 2 commits into
python:masterfrom
vstinner:ast_module_state
Jul 3, 2020
Merged

vstinner merged 2 commits into
python:masterfrom
vstinner:ast_module_state

Conversation

@vstinner

@vstinner vstinner commented Jul 3, 2020

Copy link
Copy Markdown
Member

Convert the _ast extension module to PEP 489 "Multiphase
initialization". Replace the global _ast state with a module state.

https://bugs.python.org/issue41194

Convert the _ast extension module to PEP 489 "Multiphase
initialization". Replace the global _ast state with a module state.
@vstinner

vstinner commented Jul 3, 2020

Copy link
Copy Markdown
Member Author

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with a simple question :)

Comment thread Parser/asdl_c.py Outdated
@vstinner

vstinner commented Jul 3, 2020

Copy link
Copy Markdown
Member Author

continuous-integration/travis-ci Expected — Waiting for status to be reported

But https://travis-ci.org/github/python/cpython/builds/704696576 is the build and it completed. I don't get it :-(

  • Ran for 18 min 13 sec
  • Total time 27 min 27 sec
  • 9 minutes ago

@vstinner vstinner closed this Jul 3, 2020
@vstinner vstinner reopened this Jul 3, 2020
@vstinner

vstinner commented Jul 3, 2020

Copy link
Copy Markdown
Member Author

I close/reopen my issue to force a new Travis CI build :-(

@corona10

corona10 commented Jul 3, 2020

Copy link
Copy Markdown
Member

I did same thing on #21294 :(

@corona10 corona10 closed this Jul 3, 2020
@corona10 corona10 reopened this Jul 3, 2020
@corona10

corona10 commented Jul 3, 2020

Copy link
Copy Markdown
Member

re-open :)

@vstinner
vstinner merged commit b1cc6ba into python:master Jul 3, 2020
@vstinner
vstinner deleted the ast_module_state branch July 3, 2020 18:01
vstinner added a commit that referenced this pull request Aug 10, 2020
* bpo-41194: Convert _ast extension to PEP 489 (GH-21293)

Convert the _ast extension module to PEP 489 "Multiphase
initialization". Replace the global _ast state with a module state.

(cherry picked from commit b1cc6ba)

* bpo-41204: Fix compiler warning in ast_type_init() (GH-21307)

(cherry picked from commit 1f76453)
Comment thread Parser/asdl_c.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in https://bugs.python.org/issue41631, this is incorrect :(
PyImport_GetModule looks in sys.modules, which is modifiable by the user, and so it's not guaranteed to return _ast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants