diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-07-07 23:46:28 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-07-07 23:46:28 -0700 |
commit | f2770d06d66074e704454403515e516727a496cc (patch) | |
tree | d410695b63dcd60b3dfb853c857bc3eb864b13be | |
parent | ed303d89530b2aafaf1c8a95b2828d35dac7e006 (diff) | |
download | portage-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.py | 6 |
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=[] |