handle case where ignore patterns not defined
This commit is contained in:
parent
105df0d4b0
commit
14e1a5d2e0
1 changed files with 10 additions and 7 deletions
|
@ -140,13 +140,16 @@ def parseArguments(argv):
|
||||||
|
|
||||||
|
|
||||||
def should_ignore(fileName, patterns):
|
def should_ignore(fileName, patterns):
|
||||||
for pattern in patterns:
|
try:
|
||||||
try:
|
for pattern in patterns:
|
||||||
compiled = re.compile(pattern, re.IGNORECASE)
|
try:
|
||||||
if compiled.search(fileName):
|
compiled = re.compile(pattern, re.IGNORECASE)
|
||||||
return pattern
|
if compiled.search(fileName):
|
||||||
except re.error as ex:
|
return pattern
|
||||||
log.warning('Regex error (%s) for ignore pattern: %s' % (str(ex), pattern))
|
except re.error as ex:
|
||||||
|
log.warning('Regex error (%s) for ignore pattern: %s' % (str(ex), pattern))
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue