Skip to content

gh-126944: Better error for missing arg in pdb#126945

Closed
hauntsaninja wants to merge 3 commits intopython:mainfrom
hauntsaninja:126944
Closed

gh-126944: Better error for missing arg in pdb#126945
hauntsaninja wants to merge 3 commits intopython:mainfrom
hauntsaninja:126944

Conversation

@hauntsaninja
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@hauntsaninja hauntsaninja deleted the 126944 branch April 6, 2025 21:47
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