summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-04-06 10:08:25 (GMT)
committerGitHub <noreply@github.com>2023-04-06 10:08:25 (GMT)
commit482b6eeadcde3e6573f0d243e687de7be7680379 (patch)
tree293a6be3605658c75e0b398268180142af46d1da /Lib/test/test_asyncio
parenta44568b80dfc494759d45db59423ed314bc70f9e (diff)
downloadcpython-482b6eeadcde3e6573f0d243e687de7be7680379.zip
cpython-482b6eeadcde3e6573f0d243e687de7be7680379.tar.gz
cpython-482b6eeadcde3e6573f0d243e687de7be7680379.tar.bz2
gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293)
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py2
-rw-r--r--Lib/test/test_asyncio/utils.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 731fa0c..31622c9 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -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:
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py
index 5b9c86e..6dee5bb 100644
--- a/Lib/test/test_asyncio/utils.py
+++ b/Lib/test/test_asyncio/utils.py
@@ -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)