| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah!
Sorry, something went wrong.
Wait, I made a mistake in the refcount test. The TracebackException object is an intermediate, I need to assign it to something. |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry I didn't catch that. :-(
Let me know when you are confident enough that I can merge this.
Sorry, something went wrong.
|
I think it’s ready now. |
Sorry, something went wrong.
|
BTW - the faulty test did fail on the old code. It must be that the exc_traceback field was closing a cycle with the test function’s frame or something like that. |
Sorry, something went wrong.
|
Actually it might make more sense to move the line that prints the "traceback header" to StackSummary.format(), where the traceback itself is being formatted. |
Sorry, something went wrong.
Except that would change the behavior of TracebackException.format(), which feels like a public(ish) API. |
Sorry, something went wrong.
Yes, I'm adding a with_header=False arg to format(). Alternatively, we could leave the header line where it is but under "if self.stack:" and remove the _print_traceback_header boolean. |
Sorry, something went wrong.
This is the cause - the TracebackException was not really intermediate because format() returns a generator: (Pdb) gc.get_referrers(gc.get_referrers(exc_info[2])[2]) |
Sorry, something went wrong.
|
I went for just removing the boolean. At this point moving the header line (as an opt-in) won't make the code clearer than this. |
Sorry, something went wrong.
There was a problem hiding this comment.
Okay, though I am curious why the original fixer didn't do it that way...
Sorry, something went wrong.
| if self._print_traceback_header: | ||
| if self.stack: | ||
| yield 'Traceback (most recent call last):\n' | ||
| yield from self.stack.format() |
There was a problem hiding this comment.
Maybe indent this line too then?
Sorry, something went wrong.
There was a problem hiding this comment.
Let's sit on this for a day...
Sorry, something went wrong.
|
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
Sorry, something went wrong.
|
GH-23578 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
|
GH-23579 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
…ythonGH-23531) (cherry picked from commit 427613f) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
…ythonGH-23531) (cherry picked from commit 427613f) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue42482
Automerge-Triggered-By: GH:gvanrossum