Skip to content
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-126944: Better error for missing arg in pdb #126945

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hauntsaninja
Copy link
Contributor

@hauntsaninja hauntsaninja commented Nov 18, 2024

@@ -1774,6 +1774,9 @@ def _getval(self, arg):
try:
return eval(arg, self.curframe.f_globals, self.curframe.f_locals)
except:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add more detailed error handling, even if it's just

expect Exception:

would be better

@gaogaotiantian
Copy link
Member

This might be the minimum amount of code to fix the issue, but I don't think this is the correct place. It's not obvious why _getval would generate an error message. We should check the args for all the commands that require an argument (see many _print_invalid_args() calls in pdb.py) and print the error if the argument is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants