diff options
author | dol-sen <brian.dolbec@gmail.com> | 2011-07-12 22:34:01 -0700 |
---|---|---|
committer | dol-sen <brian.dolbec@gmail.com> | 2011-07-12 22:34:01 -0700 |
commit | 752c3db97d11ab07b5a0ed9c5cd892cc5e610854 (patch) | |
tree | 37e9907d4727c685f517fcc89ea2c2123fc8a7e4 /pym/gentoolkit/eclean/exclude.py | |
parent | fix the use of set updates and the with statement. (diff) | |
download | gentoolkit-752c3db97d11ab07b5a0ed9c5cd892cc5e610854.tar.gz gentoolkit-752c3db97d11ab07b5a0ed9c5cd892cc5e610854.tar.bz2 gentoolkit-752c3db97d11ab07b5a0ed9c5cd892cc5e610854.zip |
fix a possibility of a None type error in exclDictMatchCP
Diffstat (limited to 'pym/gentoolkit/eclean/exclude.py')
-rw-r--r-- | pym/gentoolkit/eclean/exclude.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/gentoolkit/eclean/exclude.py b/pym/gentoolkit/eclean/exclude.py index 5f48cab..961bb14 100644 --- a/pym/gentoolkit/eclean/exclude.py +++ b/pym/gentoolkit/eclean/exclude.py @@ -199,13 +199,20 @@ def exclDictExpand(exclude): def exclDictMatchCP(exclude,pkg): """Checks whether a CP matches the exclusion rules.""" + if pkg is None: + return False if 'anti-packages' in exclude and pkg in exclude['anti-packages']: return False if 'packages' in exclude and pkg in exclude['packages']: return True - cat = pkg.split('/')[0] + try: + cat = pkg.split('/')[0] + except: + dprint( "exclude", "exclDictMatchCP: Invalid package name: " +\ + "%s, Could not determine category" %pkg) + cat = '' if 'categories' in exclude and cat in exclude['categories']: - return True + return True return False def exclDictExpandPkgname(exclude): |