-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-111719: Add extra check for alias command #111720
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
Conversation
if idx < len(args): | ||
self.error(f"Too many arguments for alias '{args[0]}'") | ||
# This is a no-op | ||
return "!" |
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.
Why is this return needed?
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.
Because onecmd
expects a command, and returning a False
-like value would be equivalent to returning an empty line - and cmd considers an empty line as "repeat last command". If you do "enter" in pdb, that's repeat last command.
@@ -616,6 +625,7 @@ def precmd(self, line): | |||
|
|||
# Replace all the convenience variables | |||
line = re.sub(r'\$([a-zA-Z_][a-zA-Z0-9_]*)', r'__pdb_convenience_variables["\1"]', line) | |||
|
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.
alias
command inpdb
#111719📚 Documentation preview 📚: https://cpython-previews--111720.org.readthedocs.build/