diff --git a/python/lib/communication/dmod/communication/websocket_interface.py b/python/lib/communication/dmod/communication/websocket_interface.py index 0de4f9893..9cbf45e59 100644 --- a/python/lib/communication/dmod/communication/websocket_interface.py +++ b/python/lib/communication/dmod/communication/websocket_interface.py @@ -87,7 +87,8 @@ def _get_async_loop(cls): def __del__(self): try: - asyncio.run(self.shutdown()) + if self._loop.is_running(): + self._loop.run_until_complete(self.shutdown()) except Exception as e: pass