Fixed the exception scope behavior

This commit is contained in:
Tarek Ziade 2012-02-21 14:28:12 +01:00
parent d8f6e431f1
commit ef4b069970
5 changed files with 18 additions and 14 deletions

View file

@ -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)