diff options
author | Victor Stinner <vstinner@python.org> | 2020-11-02 21:03:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 21:03:28 (GMT) |
commit | 5cf4782a2630629d0978bf4cf6b6340365f449b2 (patch) | |
tree | e54caf1ea68b6c0ded1d72d72a35db3ab7224138 /PCbuild | |
parent | 34637a0ce21e7261b952fbd9d006474cc29b681f (diff) | |
download | cpython-5cf4782a2630629d0978bf4cf6b6340365f449b2.zip cpython-5cf4782a2630629d0978bf4cf6b6340365f449b2.tar.gz cpython-5cf4782a2630629d0978bf4cf6b6340365f449b2.tar.bz2 |
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
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/regen.vcxproj | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 90d6dc6..936f5fd 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -137,6 +137,8 @@ </None> <None Include="..\Include\opcode.h"> </None> + <None Include="..\Include\internal\pycore_ast.h"> + </None> <None Include="..\Include\Python-ast.h"> </None> <None Include="..\Python\Python-ast.c"> @@ -161,15 +163,18 @@ <Warning Text="Pegen updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedParse)' != ''" /> </Target> <Target Name="_RegenAST_H" AfterTargets="_RegenGrammar"> - <!-- Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py -h --> - <Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" "$(PySourcePath)Parser\Python.asdl" -H "$(IntDir)Python-ast.h" -C "$(IntDir)Python-ast.c"" /> + <!-- Regenerate Include/Python-ast.h, Python/Python-ast.c and Include/internal/pycore_ast.h using Parser/asdl_c.py -h --> + <Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" "$(PySourcePath)Parser\Python.asdl" -H "$(IntDir)Python-ast.h" -C "$(IntDir)Python-ast.c" -I "$(IntDir)pycore_ast.h"" /> <Copy SourceFiles="$(IntDir)Python-ast.h" DestinationFiles="$(PySourcePath)Include\Python-ast.h"> <Output TaskParameter="CopiedFiles" ItemName="_UpdatedH" /> </Copy> <Copy SourceFiles="$(IntDir)Python-ast.c" DestinationFiles="$(PySourcePath)Python\Python-ast.c"> <Output TaskParameter="CopiedFiles" ItemName="_UpdatedC" /> </Copy> - <Warning Text="ASDL is updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' and '@(_UpdatedC)' != ''" /> + <Copy SourceFiles="$(IntDir)pycore_ast.h" DestinationFiles="$(PySourcePath)Include\internal\pycore_ast.h"> + <Output TaskParameter="CopiedFiles" ItemName="_UpdatedInternalH" /> + </Copy> + <Warning Text="ASDL is updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' != '' and '@(_UpdatedC)' != '' and @(_UpdatedInternalH)'" /> </Target> <Target Name="_RegenOpcodes" AfterTargets="_RegenAST_C"> <!-- Regenerate Include/opcode.h from Lib/opcode.py using Tools/scripts/generate_opcode_h.py--> @@ -204,6 +209,7 @@ <Clean Include="$(IntDir)opcode.h" /> <Clean Include="$(IntDir)Python-ast.c" /> <Clean Include="$(IntDir)Python-ast.h" /> + <Clean Include="$(IntDir)pycore_ast.h" /> </ItemGroup> </Target> </Project> |