mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Fixes #41
Seems like the patch that fixed skipping some warnings broke this.
This commit is contained in:
parent
7d2b8e6b07
commit
caab4bd18d
1 changed files with 3 additions and 0 deletions
|
|
@ -5,6 +5,9 @@ import os
|
|||
|
||||
def skip_warning(warning, ignore=[]):
|
||||
# XXX quick dirty hack, just need to keep the line in the warning
|
||||
if not hasattr(warning, message):
|
||||
# McCabe's warnings cannot be skipped afaik, and they're all strings.
|
||||
return False
|
||||
if warning.message.split()[0] in ignore:
|
||||
return True
|
||||
if not os.path.isfile(warning.filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue