mirror of
https://github.com/python/cpython
synced 2024-09-16 01:45:23 +00:00
Fix the Tools/peg_generator/scripts/benchmark.py script (GH-19848)
This commit is contained in:
parent
289842ae82
commit
6bd99d5f00
|
@ -15,7 +15,7 @@
|
|||
from pegen.python_generator import PythonParserGenerator
|
||||
from pegen.tokenizer import Tokenizer
|
||||
|
||||
MOD_DIR = pathlib.Path(__file__).parent
|
||||
MOD_DIR = pathlib.Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def get_extra_flags(compiler_flags: str, compiler_py_flags_nodist: str) -> List[str]:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
sys.path.insert(0, os.getcwd())
|
||||
from peg_extension import parse
|
||||
from pegen.build import build_parser_and_generator
|
||||
from pegen.build import build_c_parser_and_generator
|
||||
from scripts.test_parse_directory import parse_directory
|
||||
|
||||
argparser = argparse.ArgumentParser(
|
||||
|
@ -93,8 +93,9 @@ def run_benchmark_stdlib(subcommand, parser):
|
|||
modes = {"compile": 2, "parse": 1, "check": 0}
|
||||
extension = None
|
||||
if parser == "pegen":
|
||||
extension = build_parser_and_generator(
|
||||
extension = build_c_parser_and_generator(
|
||||
"../../Grammar/python.gram",
|
||||
"../../Grammar/Tokens",
|
||||
"peg_extension/parse.c",
|
||||
compile_extension=True,
|
||||
skip_actions=False,
|
||||
|
|
Loading…
Reference in a new issue