mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-02 19:56:52 +00:00
make sure skip_warning works with no files
This commit is contained in:
parent
3027204914
commit
0d0d5d84b5
1 changed files with 3 additions and 0 deletions
|
|
@ -1,8 +1,11 @@
|
|||
import re
|
||||
import os
|
||||
|
||||
|
||||
def skip_warning(warning):
|
||||
# XXX quick dirty hack, just need to keep the line in the warning
|
||||
if not os.path.isfile(warning.filename):
|
||||
return False
|
||||
line = open(warning.filename).readlines()[warning.lineno - 1]
|
||||
return skip_line(line)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue