From 380537d49c1ce04d184ab424a893559e6b0a6d5b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 19 Jan 2015 00:42:39 +0100 Subject: [PATCH] run_checks: Run pep257 via subprocess. --- scripts/run_checks.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/scripts/run_checks.py b/scripts/run_checks.py index a577468c4..d7181c22e 100755 --- a/scripts/run_checks.py +++ b/scripts/run_checks.py @@ -99,27 +99,6 @@ def run(name, target=None): return status -def check_pep257(target): - """Run pep257 checker with args passed.""" - # pylint: disable=assignment-from-no-return,no-member - args = _get_args('pep257') - sys.argv = ['pep257', target] - if args is not None: - sys.argv += args - try: - if hasattr(pep257, 'run_pep257'): - # newer pep257 versions - status = pep257.run_pep257() - else: - # older pep257 versions - status = pep257.main(*pep257.parse_options()) - print() - return status - except Exception: - traceback.print_exc() - return None - - def check_unittest(): """Run the unittest checker.""" suite = unittest.TestLoader().discover('.') @@ -248,7 +227,7 @@ def _get_checkers(): # "Dynamic" checkers which exist once for each target. for target in config.get('DEFAULT', 'targets').split(','): checkers[target] = collections.OrderedDict([ - ('pep257', functools.partial(check_pep257, target)), + ('pep257', functools.partial(run, 'pep257', target)), ('flake8', functools.partial(run, 'flake8', target)), ('vcs', functools.partial(check_vcs_conflict, target)), ('pylint', functools.partial(run, 'pylint', target)),