mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293)
This commit is contained in:
parent
a44568b80d
commit
482b6eeadc
12 changed files with 68 additions and 71 deletions
|
|
@ -606,7 +606,7 @@ class BaseTaskTests:
|
|||
if (
|
||||
timed_out
|
||||
and task.uncancel() == 0
|
||||
and sys.exc_info()[0] is asyncio.CancelledError
|
||||
and type(sys.exception()) is asyncio.CancelledError
|
||||
):
|
||||
# Note the five rules that are needed here to satisfy proper
|
||||
# uncancellation:
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ class TestCase(unittest.TestCase):
|
|||
|
||||
# Detect CPython bug #23353: ensure that yield/yield-from is not used
|
||||
# in an except block of a generator
|
||||
self.assertEqual(sys.exc_info(), (None, None, None))
|
||||
self.assertIsNone(sys.exception())
|
||||
|
||||
self.doCleanups()
|
||||
threading_helper.threading_cleanup(*self._thread_cleanup)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue