Fix "UnboundLocalError: local variable 'real_vardb' referenced before assignment".
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Mon, 30 Aug 2010 13:02:12 +0000 (15:02 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Mon, 30 Aug 2010 13:02:12 +0000 (15:02 +0200)
pym/_emerge/actions.py

index 707bb7b41df683d459144e92e5b6e089ba9c250e..5be9a9dc5140fea83787deac4f98d137326df3f1 100644 (file)
@@ -881,6 +881,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
        cleanlist = create_cleanlist()
        clean_set = set(cleanlist)
 
+       real_vardb = trees[myroot]["vartree"].dbapi
        if cleanlist and \
                real_vardb._linkmap is not None and \
                myopts.get('--depclean-lib-check') != 'n':
@@ -888,7 +889,6 @@ def calc_depclean(settings, trees, ldpath_mtimes,
                # Check if any of these packages are the sole providers of libraries
                # with consumers that have not been selected for removal. If so, these
                # packages and any dependencies need to be added to the graph.
-               real_vardb = trees[myroot]["vartree"].dbapi
                linkmap = real_vardb._linkmap
                consumer_cache = {}
                provider_cache = {}