From: dol-sen Date: Wed, 13 Jul 2011 05:34:01 +0000 (-0700) Subject: fix a possibility of a None type error in exclDictMatchCP X-Git-Tag: gentoolkit-0.3.0.5~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=752c3db97d11ab07b5a0ed9c5cd892cc5e610854;p=gentoolkit.git fix a possibility of a None type error in exclDictMatchCP --- 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):