File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,23 @@ def run(self):
5959 self .clear_triggers ()
6060
6161 response = None
62+ exception = None
6263 while True :
6364 try :
64- command = self .coroutine .send (response )
65+ if exception is None :
66+ command = self .coroutine .send (response )
67+ else :
68+ command = self .coroutine .throw (exception )
69+ except StopIteration :
70+ self .passive = True
71+ self .coroutine = None
72+ return
73+
74+ try :
6575 if command is None :
6676 command = self .default_cmd
6777 response = None
78+ exception = None
6879
6980 if isinstance (command , ValueCastable ):
7081 command = Value .cast (command )
@@ -118,10 +129,6 @@ def run(self):
118129 raise TypeError ("Received unsupported command {!r} from process {!r}"
119130 .format (command , self .src_loc ()))
120131
121- except StopIteration :
122- self .passive = True
123- self .coroutine = None
124- return
125-
126132 except Exception as exn :
127- self .coroutine .throw (exn )
133+ response = None
134+ exception = exn
Original file line number Diff line number Diff line change @@ -685,7 +685,6 @@ def process():
685685 with self .assertRaisesRegex (TypeError ,
686686 r"Received unsupported command 1 from process .+?" ):
687687 yield 1
688- yield Settle ()
689688 survived = True
690689 sim .add_process (process )
691690 self .assertTrue (survived )
You can’t perform that action at this time.
0 commit comments