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/emaint
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/emaint')
-rwxr-xr-xbin/emaint3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/emaint b/bin/emaint
index 08e75851a..a26dae1e7 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -31,6 +31,7 @@ if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".porta
import portage
portage._internal_caller = True
from portage.emaint.main import emaint_main
+from portage.util._eventloop.global_event_loop import global_event_loop
try:
emaint_main(sys.argv[1:])
@@ -40,3 +41,5 @@ except IOError as e:
sys.exit(1)
else:
raise
+finally:
+ global_event_loop().close()