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):
59
59
self .clear_triggers ()
60
60
61
61
response = None
62
+ exception = None
62
63
while True :
63
64
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 :
65
75
if command is None :
66
76
command = self .default_cmd
67
77
response = None
78
+ exception = None
68
79
69
80
if isinstance (command , ValueCastable ):
70
81
command = Value .cast (command )
@@ -118,10 +129,6 @@ def run(self):
118
129
raise TypeError ("Received unsupported command {!r} from process {!r}"
119
130
.format (command , self .src_loc ()))
120
131
121
- except StopIteration :
122
- self .passive = True
123
- self .coroutine = None
124
- return
125
-
126
132
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():
685
685
with self .assertRaisesRegex (TypeError ,
686
686
r"Received unsupported command 1 from process .+?" ):
687
687
yield 1
688
- yield Settle ()
689
688
survived = True
690
689
sim .add_process (process )
691
690
self .assertTrue (survived )
You can’t perform that action at this time.
0 commit comments