Closed
Description
PR #3384 introduced code that resets sys.last_traceback
and friends by assigning None
to them:
Line 124 in 7e10c81
The normal CPython behaviour here is that once the exception has been cleared, the attributes are del
eted rather than set to None
. Could I suggest updating this line of code to delete the attributes?
For context: the None
s caused test failures in another project when we attempted to switch from unittest discover
to pytest
as our test runner; we had a test for some complex code that was messing with various sys
attributes including the sys.last_*
attributes, and the test verified that those attributes were unchanged by the code under test.