aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-05-06 14:28:25 -0700
committerZac Medico <zmedico@gentoo.org>2018-05-06 15:51:23 -0700
commit2d500ce2bc96995752dfc2fb475a7abe907e38b6 (patch)
treeac09653b246ed10d4aaf998a6d52addbd69e6533 /bin/ebuild-ipc.py
parentasyncio: add _wrap_loop helper (bug 654390) (diff)
downloadportage-2d500ce2bc96995752dfc2fb475a7abe907e38b6.tar.gz
portage-2d500ce2bc96995752dfc2fb475a7abe907e38b6.tar.bz2
portage-2d500ce2bc96995752dfc2fb475a7abe907e38b6.zip
asyncio: explicitly close event loops (bug 654390)
The default asyncio event loop triggers a resource warning if it is not explicitly closed, therefore close it when appropriate. Bug: https://bugs.gentoo.org/654390
Diffstat (limited to 'bin/ebuild-ipc.py')
-rwxr-xr-xbin/ebuild-ipc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 6d0cdbef9..1f323bdc5 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -273,4 +273,7 @@ def ebuild_ipc_main(args):
return ebuild_ipc.communicate(args)
if __name__ == '__main__':
- sys.exit(ebuild_ipc_main(sys.argv[1:]))
+ try:
+ sys.exit(ebuild_ipc_main(sys.argv[1:]))
+ finally:
+ global_event_loop().close()