mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix some scripts in the peg generator folder (GH-19853)
This commit is contained in:
parent
02047265eb
commit
9dbaa8d9f0
10 changed files with 16064 additions and 31 deletions
|
@ -3,6 +3,7 @@ import shutil
|
|||
import tokenize
|
||||
import sys
|
||||
import sysconfig
|
||||
import tempfile
|
||||
import itertools
|
||||
|
||||
from typing import Optional, Tuple, List, IO, Iterator, Set, Dict
|
||||
|
@ -162,9 +163,13 @@ def build_c_generator(
|
|||
gen.generate(grammar_file)
|
||||
|
||||
if compile_extension:
|
||||
compile_c_extension(
|
||||
output_file, verbose=verbose_c_extension, keep_asserts=keep_asserts_in_extension
|
||||
)
|
||||
with tempfile.TemporaryDirectory() as build_dir:
|
||||
compile_c_extension(
|
||||
output_file,
|
||||
build_dir=build_dir,
|
||||
verbose=verbose_c_extension,
|
||||
keep_asserts=keep_asserts_in_extension,
|
||||
)
|
||||
return gen
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue