File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,10 +268,9 @@ def __step(self, exc=None):
268268 raise exceptions .InvalidStateError (
269269 f'__step(): already done: { self !r} , { exc !r} ' )
270270 if self ._must_cancel :
271- # gh-108549: do not swallow SystemExit and KeyboardInterrupt
271+ # gh-108549: do not swallow SystemExit and KeyboardInterrupt.
272272 if not isinstance (exc , (exceptions .CancelledError ,
273- SystemExit , KeyboardInterrupt )
274- ):
273+ SystemExit , KeyboardInterrupt )):
275274 exc = self ._make_cancelled_error ()
276275 self ._must_cancel = False
277276 self ._fut_waiter = None
Original file line number Diff line number Diff line change @@ -1904,6 +1904,7 @@ async def current_task(exc):
19041904 pass
19051905 except BaseException as e :
19061906 self .fail (f'{ exc } is expected, instead of { type (e )} ' )
1907+ return "ok"
19071908
19081909 for exc in (SystemExit , KeyboardInterrupt ):
19091910 with self .subTest (exc ):
@@ -1912,6 +1913,7 @@ async def current_task(exc):
19121913 t .cancel ()
19131914 test_utils .run_briefly (self .loop )
19141915 self .assertTrue (not t .cancelled ())
1916+ self .assertEqual (t .result (), "ok" )
19151917
19161918 def test_step_result_future (self ):
19171919 # If coroutine returns future, task waits on this future.
You can’t perform that action at this time.
0 commit comments