Prevent warning on __del__ during tests

This commit is contained in:
Matthias
2024-06-16 09:56:03 +02:00
parent 2223c16d00
commit a9ebefdc37

View File

@@ -258,7 +258,7 @@ class Exchange:
def close(self):
logger.debug("Exchange object destroyed, closing async loop")
if (
self._api_async
getattr(self, "_api_async", None)
and inspect.iscoroutinefunction(self._api_async.close)
and self._api_async.session
):