Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-79932: raise exception if frame.clear() is called on a suspended frame#111792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 7 commits intopython:mainfromiritkatriel:suspended_clear
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from1 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
PrevPrevious commit
NextNext commit
Revert "update traceback module to use the new arg"
This reverts commit0e570d0.
  • Loading branch information
@iritkatriel
iritkatriel committedNov 6, 2023
commit07b480a84a497ccf5c11d0840accf5fc4bb200fb
19 changes: 0 additions & 19 deletionsLib/test/test_traceback.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionLib/traceback.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp