def quit(self): """Shut down the SC2 process.""" try: # Don't expect a response. self._client.write(sc_pb.Request(quit=sc_pb.RequestQuit())) except protocol.ConnectionError: pass # It's likely already (shutting) down, so continue as if it worked. finally: self.close()
async def quit(self): try: await self._execute(quit=sc_pb.RequestQuit()) except ConnectionAlreadyClosed: pass
def quit(self): """Shut down the SC2 process.""" try: return self._client.send(quit=sc_pb.RequestQuit()) except protocol.ConnectionError: pass # It's likely already (shutting) down, so continue as if it worked.
async def quit(self): await self._execute(quit=sc_pb.RequestQuit())
async def quit(self): try: await self._execute(quit=sc_pb.RequestQuit()) except websockets.exceptions.ConnectionClosed: pass
async def quit(self): with suppress(ConnectionAlreadyClosed, ConnectionResetError): await self._execute(quit=sc_pb.RequestQuit())