Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "update traceback module to use the new arg"
This reverts commit 0e570d0.
  • Loading branch information
iritkatriel committed Nov 6, 2023
commit 07b480a84a497ccf5c11d0840accf5fc4bb200fb
19 changes: 0 additions & 19 deletions Lib/test/test_traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -2518,25 +2518,6 @@ def inner():
# Local variable dict should now be empty.
self.assertEqual(len(inner_frame.f_locals), 0)

def test_do_not_clear_frame_of_suspended_generator(self):
# See gh-79932

def f():
try:
raise TypeError
except Exception as e:
yield e
yield 42

def g():
yield from f()

gen = g()
e = next(gen)
self.assertIsInstance(e, TypeError)
traceback.clear_frames(e.__traceback__)
self.assertEqual(next(gen), 42)

def test_extract_stack(self):
def extract():
return traceback.extract_stack()
Expand Down
2 changes: 1 addition & 1 deletion Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def clear_frames(tb):
"Clear all references to local variables in the frames of a traceback."
while tb is not None:
try:
tb.tb_frame.clear(True)
tb.tb_frame.clear()
except RuntimeError:
# Ignore the exception raised if the frame is still executing.
pass
Expand Down