-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed
Description
PR #3384 introduced code that resets sys.last_traceback
and friends by assigning None
to them:
Line 124 in 7e10c81
sys.last_type, sys.last_value, sys.last_traceback = (None, None, None) |
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.
blueyed
Metadata
Metadata
Assignees
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed