-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116000: Make Tools/cases_generator/optimizer_generator.py
work without any arguments
#116470
Conversation
@@ -27,7 +27,7 @@ | |||
from stack import Stack, SizeMismatch, UNUSED | |||
|
|||
DEFAULT_OUTPUT = ROOT / "Python/optimizer_cases.c.h" | |||
DEFAULT_ABSTRACT_INPUT = ROOT / "Python/optimizer_bytecodes.c" | |||
DEFAULT_ABSTRACT_INPUT = (ROOT / "Python/optimizer_bytecodes.c").absolute().as_posix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is needed because of parser/prettify_filename
which works only with an str
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Though honestly, I wish we weren't using pathlib at all here -- it's been nothing but trouble.
Some kind of proof that this PR works: Run without arguments: eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ python3.11 optimizer_generator.py
eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ Run with explicit arguments: eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ python3.11 optimizer_generator.py ../../Python/optimizer_bytecodes.c ../../Python/bytecodes.c
eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ |
Would be even more convincing if after the default run |
Sure! Run without args: eclips4@HOME-PC:~/CLionProjects/cpython$ python3.11 Tools/cases_generator/optimizer_generator.py
eclips4@HOME-PC:~/CLionProjects/cpython$ git diff
eclips4@HOME-PC:~/CLionProjects/cpython$ Run with args: eclips4@HOME-PC:~/CLionProjects/cpython$ python3.11 Tools/cases_generator/optimizer_generator.py Python/optimizer_bytecodes.c Pyth
on/bytecodes.c
eclips4@HOME-PC:~/CLionProjects/cpython$ git diff
eclips4@HOME-PC:~/CLionProjects/cpython$ |
Tools/cases_generator/optimizer_generator
CLI does not work without explicit arguments #116000