Uh oh!
There was an error while loading. Please reload this page.
gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions - #123173
Conversation
markshannon
left a comment
There was a problem hiding this comment.
The code change looks good.
At least class Iter and maybe some more of the tests could be shared
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When you're done making the requested changes, leave the comment: |
…tions from broken iterables in comprehensions
iritkatriel
commented
Aug 21, 2024
I have made the requested changes; please review again. |
Thanks for making the requested changes! @markshannon: please review the changes made to this pull request. |
markshannon
left a comment
There was a problem hiding this comment.
Looks good.
The code in the three with self.subTest(func) blocks look the same/very similar. I think they could be factored out, but that might just end up obscuring the intent. It's up to you if you want to factor it further.
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, @iritkatriel, I could not cleanly backport this to |
Sorry, @iritkatriel, I could not cleanly backport this to |
…f exceptions from broken iterables in comprehensions (pythonGH-123173). (cherry picked from commit ec89620) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
GH-123209 is a backport of this pull request to the 3.13 branch. |
…f exceptions from broken iterables in comprehensions (pythonGH-123173). (cherry picked from commit ec89620) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
GH-123210 is a backport of this pull request to the 3.12 branch. |
…tions from broken iterables in comprehensions (python#123173)
15r10nk
commented
Aug 26, 2024
@iritkatriel might it be that this fix changed the source range for exceptions in classFoo:
def__iter__(self):
assertFalsea= [xforxinFoo()]output (Python 3.13.0rc1+): Traceback (mostrecentcalllast):
File"/home/frank/projects/cpython/codi.py", line5, in<module>a= [xforxinFoo()]
^^^^^^^^^^^^^^^^^^File"/home/frank/projects/cpython/codi.py", line3, in__iter__assertFalse^^^^^AssertionErrorThis is the example from the issue and I'm a little confused as to whether it was just forgotten or if I'm missing something here. |
iritkatriel
commented
Aug 27, 2024
So it seems. The test doesn't check for this too. Thanks for reporting, I'll fix. |
Uh oh!
There was an error while loading. Please reload this page.