--- a/checker.py Mon Jun 20 00:11:57 2016 +0800
+++ b/checker.py Thu Jun 23 14:38:55 2016 +0800
-def run_ignore_1(fn, args):
+def run_ignore_codes(fn, args, codes):
except CalledProcessError as e:
+ if e.returncode not in codes:
-def run(args, silent=False, get_output=False, ignore_1=False):
+def run(args, silent=False, get_output=False, ignore_codes=None):
print('$ ' + ' '.join(args))
- result = run_ignore_1(fn, args)
+ result = run_ignore_codes(fn, args, ignore_codes)
cmd = ['hg', 'files', 'set:' + ' or '.join(linter['files'])]
- files = run(cmd, silent=True, get_output=True, ignore_1=True)
+ files = run(cmd, silent=True, get_output=True, ignore_codes=(1,))
for f in files.splitlines():
cmd = [os.path.join(venv, 'bin', linter['cmd'])]
- if not run(cmd + linter.get('flags', []) + [f], ignore_1=True):
+ if not run(cmd + linter.get('flags', []) + [f], ignore_codes=(1,)):