Fix missing file issues in check-code

This commit is contained in:
Keith Mitchell
2013-03-08 10:51:46 -08:00
committed by Max Goodman
parent fc9abd1dcb
commit 73f0d97348

View File

@@ -128,10 +128,13 @@ def select_files(files):
if re.match(PYFILE, f):
yield f
else:
with open(f) as f_:
first = f_.readline()
if first.startswith('#!') and 'python' in first:
yield f
try:
with open(f) as f_:
first = f_.readline()
if first.startswith('#!') and 'python' in first:
yield f
except (IOError, OSError):
logging.exception("Unable to check-code against %s", f)
def extract_errtype(violation, tool):