set default for getattr

This commit is contained in:
Khris Richardson 2014-08-04 13:42:26 -05:00 committed by Colton Myers
parent ec79ad45ec
commit 1da9cdc84d

View File

@ -128,7 +128,7 @@ def _get_virtual():
if 'pkg._get_virtual' not in __context__: if 'pkg._get_virtual' not in __context__:
__context__['pkg._get_virtual'] = {} __context__['pkg._get_virtual'] = {}
apt_cache = apt.cache.Cache() apt_cache = apt.cache.Cache()
pkgs = getattr(apt_cache._cache, 'packages') pkgs = getattr(apt_cache._cache, 'packages', [])
for pkg in pkgs: for pkg in pkgs:
if pkg.provides_list: if pkg.provides_list:
for item in pkg.provides_list: for item in pkg.provides_list: