From 55101e694525c823c23a787547b7fa982b2c8456 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 8 Jun 2013 18:17:34 -0700 Subject: [PATCH] emerge_main: call portdbapi destructors --- pym/_emerge/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 4b9af7ca8..689d1364f 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1055,4 +1055,11 @@ def emerge_main(args=None): emerge_config.action, emerge_config.opts, emerge_config.args = \ parse_opts(tmpcmdline) - return run_action(emerge_config) + try: + return run_action(emerge_config) + finally: + # Call destructors for our portdbapi instances. + for x in emerge_config.trees.values(): + if "porttree" in x.lazy_items: + continue + x["porttree"].dbapi.close_caches() -- 2.26.2