mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
Fixed the exception scope behavior
This commit is contained in:
parent
d8f6e431f1
commit
ef4b069970
5 changed files with 18 additions and 14 deletions
|
|
@ -6,7 +6,11 @@ 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]
|
||||
|
||||
# XXX should cache the file in memory
|
||||
with open(warning.filename) as f:
|
||||
line = f.readlines()[warning.lineno - 1]
|
||||
|
||||
return skip_line(line)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue