Skip to content

Commit

Permalink
Fix the Tools/peg_generator/scripts/benchmark.py script (GH-19848)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed May 1, 2020
1 parent 289842a commit 6bd99d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tools/peg_generator/pegen/build.py
Expand Up @@ -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]:
Expand Down
5 changes: 3 additions & 2 deletions Tools/peg_generator/scripts/benchmark.py
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6bd99d5

Please sign in to comment.