mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-15 08:44:46 +00:00
Fixes critical bug in 'flake8/util.py' causing 'flake8' to crash during code analysis.
This commit is contained in:
parent
194bab1944
commit
9f9a355c58
2 changed files with 3 additions and 2 deletions
|
|
@ -15,4 +15,5 @@ Contributors (by order of appearance) :
|
||||||
- David Cramer
|
- David Cramer
|
||||||
- Peter Teichman
|
- Peter Teichman
|
||||||
- Oleg Broytman
|
- Oleg Broytman
|
||||||
- Marc Labbé
|
- Marc Labbé
|
||||||
|
- Bruno Miguel Custódio
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import os
|
||||||
|
|
||||||
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'):
|
||||||
# McCabe's warnings cannot be skipped afaik, and they're all strings.
|
# McCabe's warnings cannot be skipped afaik, and they're all strings.
|
||||||
return False
|
return False
|
||||||
if warning.message.split()[0] in ignore:
|
if warning.message.split()[0] in ignore:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue