@@ -989,7 +989,7 @@ async def communicate(self, command_factory: Callable[[Self], BaseCommand[T]]) -
989
989
if self .returncode .done ():
990
990
raise EngineTerminatedError (f"engine process dead (exit code: { self .returncode .result ()} )" )
991
991
992
- assert command .state == CommandState .NEW
992
+ assert command .state == CommandState .NEW , command . state
993
993
994
994
if self .next_command is not None :
995
995
self .next_command .result .cancel ()
@@ -1253,20 +1253,20 @@ def _handle_exception(self, exc: Exception) -> None:
1253
1253
self .finished .set_result (None )
1254
1254
1255
1255
def set_finished (self ) -> None :
1256
- assert self .state in [CommandState .ACTIVE , CommandState .CANCELLING ]
1256
+ assert self .state in [CommandState .ACTIVE , CommandState .CANCELLING ], self . state
1257
1257
if not self .result .done ():
1258
1258
self .result .set_exception (EngineError (f"engine command finished before returning result: { self !r} " ))
1259
1259
self .finished .set_result (None )
1260
1260
self .state = CommandState .DONE
1261
1261
1262
1262
def _cancel (self ) -> None :
1263
1263
if self .state != CommandState .CANCELLING and self .state != CommandState .DONE :
1264
- assert self .state == CommandState .ACTIVE
1264
+ assert self .state == CommandState .ACTIVE , self . state
1265
1265
self .state = CommandState .CANCELLING
1266
1266
self .cancel ()
1267
1267
1268
1268
def _start (self ) -> None :
1269
- assert self .state == CommandState .NEW
1269
+ assert self .state == CommandState .NEW , self . state
1270
1270
self .state = CommandState .ACTIVE
1271
1271
try :
1272
1272
self .check_initialized ()
@@ -1275,7 +1275,7 @@ def _start(self) -> None:
1275
1275
self ._handle_exception (err )
1276
1276
1277
1277
def _line_received (self , line : str ) -> None :
1278
- assert self .state in [CommandState .ACTIVE , CommandState .CANCELLING ]
1278
+ assert self .state in [CommandState .ACTIVE , CommandState .CANCELLING ], self . state
1279
1279
try :
1280
1280
self .line_received (line )
1281
1281
except EngineError as err :
0 commit comments