make sure skip_warning works with no files

This commit is contained in:
Tarek Ziade 2012-02-21 10:36:55 +01:00
parent 3027204914
commit 0d0d5d84b5

View file

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