summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-07-07 23:46:28 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-07 23:46:28 -0700
commitf2770d06d66074e704454403515e516727a496cc (patch)
treed410695b63dcd60b3dfb853c857bc3eb864b13be
parented303d89530b2aafaf1c8a95b2828d35dac7e006 (diff)
downloadportage-f2770d06d66074e704454403515e516727a496cc.tar.gz
portage-f2770d06d66074e704454403515e516727a496cc.tar.bz2
portage-f2770d06d66074e704454403515e516727a496cc.zip
cpv_expand: fix KeyError when settings is None
-rw-r--r--pym/portage/dbapi/cpv_expand.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/dbapi/cpv_expand.py b/pym/portage/dbapi/cpv_expand.py
index 7077b1feb..947194cca 100644
--- a/pym/portage/dbapi/cpv_expand.py
+++ b/pym/portage/dbapi/cpv_expand.py
@@ -3,6 +3,7 @@
__all__ = ["cpv_expand"]
+import portage
from portage.exception import AmbiguousPackageName
from portage.localization import _
from portage.util import writemsg
@@ -16,7 +17,10 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
myslash=mycpv.split("/")
mysplit = _pkgsplit(myslash[-1])
if settings is None:
- settings = globals()["settings"]
+ try:
+ settings = mydb.settings
+ except AttributeError:
+ settings = portage.settings
if len(myslash)>2:
# this is illegal case.
mysplit=[]