mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
parent
0d3cc25400
commit
8eec1e5e11
1 changed files with 2 additions and 1 deletions
|
|
@ -49,8 +49,9 @@ def get_parser():
|
||||||
|
|
||||||
def skip_warning(warning, ignore=[]):
|
def skip_warning(warning, ignore=[]):
|
||||||
# XXX quick dirty hack, just need to keep the line in the warning
|
# XXX quick dirty hack, just need to keep the line in the warning
|
||||||
if not hasattr(warning, 'message'):
|
if not hasattr(warning, 'message') or ignore is None:
|
||||||
# McCabe's warnings cannot be skipped afaik, and they're all strings.
|
# McCabe's warnings cannot be skipped afaik, and they're all strings.
|
||||||
|
# And we'll get a TypeError otherwise
|
||||||
return False
|
return False
|
||||||
if warning.message.split()[0] in ignore:
|
if warning.message.split()[0] in ignore:
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue