Mark Shannon <m...@hotpy.org> added the comment:

What exactly is the issue here?
That the line number is -1, or that is different from 3.9?

The `-1` should be `None`. I can fix that, but there is the issue of whether 
the cleanup code in a with statement should have a line number or not.

The traceback for 3.9 is incorrect, the program is not on line 10 when __exit__ 
is called.

Currently we mark the cleanup code for the with statement as artificial meaning 
that it has no line number.
We could give it the line number of the `with` keyword, but that might break 
coverage and profiling tools.

PEP 626 says that the "with" keyword is executable, and should be traced, but 
nothing about whether that includes the cleanup call to __exit__.

----------
nosy: +nedbat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43933>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to