From: Zac Medico Date: Sun, 9 Jun 2013 01:17:34 +0000 (-0700) Subject: emerge_main: call portdbapi destructors X-Git-Tag: v2.2.0_alpha179 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=55101e694525c823c23a787547b7fa982b2c8456;p=portage.git emerge_main: call portdbapi destructors --- 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()