Filipe Laíns <[email protected]> added the comment:
Upon further investigation, there are actually two issues here. The first would
be the one I identified already, traceback.FrameSummary not being prepared for
lineno being None, but there is also a regression in lineno being invalid in
this situation in the first place.
With only GH-26781, the traceback will look like the following:
File "/home/anubis/git/cpython/rep.py", line 13, in <module>
next(bar().__await__(), None)
File "/home/anubis/git/cpython/rep.py", line 10, in bar
return [chunk async for chunk in foo()]
File "/home/anubis/git/cpython/rep.py", line None, in <listcomp>
File "/home/anubis/git/cpython/rep.py", line 6, in foo
traceback.print_stack()
working!
which is different from 3.9
File "/home/anubis/git/cpython/rep.py", line 13, in <module>
next(bar().__await__(), None)
File "/home/anubis/git/cpython/rep.py", line 10, in bar
return [chunk async for chunk in foo()]
File "/home/anubis/git/cpython/rep.py", line 10, in <listcomp>
return [chunk async for chunk in foo()]
File "/home/anubis/git/cpython/rep.py", line 6, in foo
traceback.print_stack()
working!
I bisected the second issue to b37181e69209746adc2119c471599a1ea5faa6c8 which
moves generators to bytecode, and when doing so changes the behavior to set
lineno to -1. I have opened a GH-26782 to fixing this.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44446>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com