From 4c6ca0b4a0900b8446de912d492b94fc57ed6c2a Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 13 Jul 2020 20:41:16 +0200 Subject: [PATCH] api: properly close the event loop Close the event loop when the context is exited, which will clear the internal queues and shut down the executor of the event loop. Not doing this will create a warning when the object is garbage collected. --- osbuild/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/osbuild/api.py b/osbuild/api.py index 6fdb11a2..63959ae4 100644 --- a/osbuild/api.py +++ b/osbuild/api.py @@ -70,3 +70,4 @@ class API: def __exit__(self, *args): self.event_loop.call_soon_threadsafe(self.event_loop.stop) self.thread.join() + self.event_loop.close()