◐ Shell
reader mode source ↗
Skip to content

bpo-36829: Add test.support.catch_unraisable_exception()#13490

Merged
vstinner merged 3 commits into
python:masterfrom
vstinner:catch_unraisable_exception
May 22, 2019
Merged

bpo-36829: Add test.support.catch_unraisable_exception()#13490
vstinner merged 3 commits into
python:masterfrom
vstinner:catch_unraisable_exception

Conversation

@vstinner

@vstinner vstinner commented May 22, 2019

Copy link
Copy Markdown
Member
  • Copy test_exceptions.test_unraisable() to
    test_sys.UnraisableHookTest().
  • test_exceptions.test_unraisable() uses catch_unraisable_exception();
    simplify the test. test_sys now checks the exact output.
  • Use catch_unraisable_exception() in test_coroutines,
    test_exceptions, test_generators.

https://bugs.python.org/issue36829

* Copy test_exceptions.test_unraisable() to
  test_sys.UnraisableHookTest().
* test_exceptions.test_unraisable() uses catch_unraisable_exception();
  simplify the test. test_sys now checks the exact output.
* Use catch_unraisable_exception() in test_coroutines,
  test_exceptions, test_generators.
@vstinner

Copy link
Copy Markdown
Member Author

I chose to leave test_io unchanged on purpose: I have a local branch which fix also https://bugs.python.org/issue36918 in Lib/_pyio.py and use this new catch_unraisable_exception() function. Once this PR will be merged, I will write a second PR based on it.

vstinner added 2 commits May 22, 2019 18:28
Avoid the need for try/finally: __exit__ clears unraisable to break
the reference cycle.
@vstinner vstinner merged commit e4d300e into python:master May 22, 2019
@vstinner vstinner deleted the catch_unraisable_exception branch May 22, 2019 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants