bpo-41796: Make _ast module state per interpreter (GH-23024)

The ast module internal state is now per interpreter.

* Rename "astmodulestate" to "struct ast_state"
* Add pycore_ast.h internal header: the ast_state structure is now
  declared in pycore_ast.h.
* Add PyInterpreterState.ast (struct ast_state)
* Remove get_ast_state()
* Rename get_global_ast_state() to get_ast_state()
* PyAST_obj2mod() now handles get_ast_state() failures
This commit is contained in:
Victor Stinner 2020-11-02 22:03:28 +01:00 committed by GitHub
parent 34637a0ce2
commit 5cf4782a26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 549 additions and 202 deletions

2
Include/Python-ast.h generated
View file

@ -1,4 +1,4 @@
/* File automatically generated by Parser/asdl_c.py. */
// File automatically generated by Parser/asdl_c.py.
#ifndef Py_PYTHON_AST_H
#define Py_PYTHON_AST_H