8000 gh-124872: Replace enter/exit events with "switched" by Eclips4 · Pull Request #125532 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124872: Replace enter/exit events with "switched" #125532

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 16, 2024
Merged
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
Fix reference cycle
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
Eclips4 and vstinner committed Oct 16, 2024
commit caa33e9a272acd07564bc529a0d29ba3abe3f7be
18 changes: 11 additions & 7 deletions Lib/test/test_capi/test_watchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,17 @@ def _in_outer():
ctx_inner.run(lambda: unraisables.append(cm.unraisable))
unraisables.append(cm.unraisable)

ctx_outer.run(_in_outer)
self.assertEqual([x.err_msg for x in unraisables],
["Exception ignored in Py_CONTEXT_SWITCHED "
f"watcher callback for {ctx!r}"
for ctx in [ctx_inner, ctx_outer]])
self.assertEqual([str(x.exc_value) for x in unraisables],
["boom!", "boom!"])
try:
ctx_outer.run(_in_outer)
self.assertEqual([x.err_msg for x in unraisables],
["Exception ignored in Py_CONTEXT_SWITCHED "
f"watcher callback for {ctx!r}"
for ctx in [ctx_inner, ctx_outer]])
self.assertEqual([str(x.exc_value) for x in unraisables],
["boom!", "boom!"])
finally:
# Break reference cycle
unraisables = None

def test_clear_out_of_range_watcher_id(self):
with self.assertRaisesRegex(ValueError, r"Invalid context watcher ID -1"):
Expand Down
0