aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-05-16 16:28:13 -0700
committerZac Medico <zmedico@gentoo.org>2018-05-16 16:28:13 -0700
commitb414df90b50aaf73dda3708680c6951e7dc8bad9 (patch)
treec5a78ad00894de7599c5015ccd1e0acb23befb38 /repoman
parentUpdates for portage-2.3.37 release (diff)
downloadportage-b414df90b50aaf73dda3708680c6951e7dc8bad9.tar.gz
portage-b414df90b50aaf73dda3708680c6951e7dc8bad9.tar.bz2
portage-b414df90b50aaf73dda3708680c6951e7dc8bad9.zip
repoman: 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 'repoman')
-rwxr-xr-xrepoman/bin/repoman3
-rw-r--r--repoman/pym/repoman/tests/runTests.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/repoman/bin/repoman b/repoman/bin/repoman
index 7084ff918..ab04d56ca 100755
--- a/repoman/bin/repoman
+++ b/repoman/bin/repoman
@@ -38,6 +38,7 @@ if osp.isfile(osp.join(osp.dirname(osp.dirname(here)), ".repoman_not_installed")
import portage
portage._internal_caller = True
+from portage.util._eventloop.global_event_loop import global_event_loop
from repoman.main import repoman_main
try:
@@ -48,3 +49,5 @@ except IOError as e:
sys.exit(1)
else:
raise
+finally:
+ global_event_loop().close()
diff --git a/repoman/pym/repoman/tests/runTests.py b/repoman/pym/repoman/tests/runTests.py
index b0e715ec6..ed73592a1 100644
--- a/repoman/pym/repoman/tests/runTests.py
+++ b/repoman/pym/repoman/tests/runTests.py
@@ -45,6 +45,7 @@ portage._internal_caller = True
# Ensure that we don't instantiate portage.settings, so that tests should
# work the same regardless of global configuration file state/existence.
portage._disable_legacy_globals()
+from portage.util._eventloop.global_event_loop import global_event_loop
if os.environ.get('NOCOLOR') in ('yes', 'true'):
portage.output.nocolor()
@@ -66,4 +67,7 @@ if insert_bin_path:
os.environ["PATH"] = ":".join(path)
if __name__ == "__main__":
- sys.exit(tests.main())
+ try:
+ sys.exit(tests.main())
+ finally:
+ global_event_loop().close()