Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-106670: Allow Pdb to move between chained exceptions#106676
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
d39fbce920af94d24ed3c63a734766a3944b4f79ade3b9e4a948551c9ba7bb83514edc4e57c329e7354bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -206,13 +206,16 @@ def namespace(self): | ||
| # line_prefix = ': ' # Use this to get the old situation back | ||
| line_prefix = '\n-> ' # Probably a better default | ||
| class Pdb(bdb.Bdb, cmd.Cmd): | ||
| # the max number of chained exceptions + exception groups we accept to navigate. | ||
| ||
| _previous_sigint_handler = None | ||
| # Limit the maximum depth of chained exceptions, we should be handling cycles, | ||
| # but in case there are recursions, we stop at 999. | ||
| MAX_CHAINED_EXCEPTION_DEPTH = 999 | ||
| def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None, | ||
| nosigint=False, readrc=True): | ||
| bdb.Bdb.__init__(self, skip=skip) | ||
| @@ -446,9 +449,9 @@ def _get_tb_and_exceptions(self, tb_or_exc): | ||
| ): | ||
| current = current.__context__ | ||
| if len(_exceptions) >=self.MAX_CHAINED_EXCEPTION_DEPTH: | ||
| self.message( | ||
| f"More than {self.MAX_CHAINED_EXCEPTION_DEPTH}" | ||
| " chained exceptions found, not all exceptions" | ||
| "will be browsable with `exceptions`." | ||
| ) | ||