File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -756,18 +756,13 @@ def test_future_disallow_multiple_initialization(self):
756756 f .__init__ (loop = self .loop )
757757
758758 def test_futureiter_send_after_throw_no_crash (self ):
759- async def run_test ():
760- loop = asyncio .get_event_loop ()
761- fut = loop .create_future ()
762- it = fut .__await__ ()
763- it .__next__ ()
764- try :
765- it .throw (RuntimeError )
766- except RuntimeError :
767- pass
768- with self .assertRaises (StopIteration ):
769- it .send (None )
770- asyncio .run (run_test ())
759+ fut = self ._new_future ()
760+ it = fut .__await__ ()
761+ next (it )
762+ with self .assertRaises (RuntimeError ):
763+ it .throw (RuntimeError )
764+ with self .assertRaises (StopIteration ):
765+ it .send (None )
771766
772767
773768@unittest .skipUnless (hasattr (futures , '_CFuture' ),
You can’t perform that action at this time.
0 commit comments