mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Fix missing file issues in check-code
This commit is contained in:
committed by
Max Goodman
parent
fc9abd1dcb
commit
73f0d97348
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user