diff --git a/tools/lint b/tools/lint index 820f17bb29..c55a8624f6 100755 --- a/tools/lint +++ b/tools/lint @@ -115,7 +115,7 @@ def run(): @linter_config.lint def pyflakes(): # type: () -> int - failed = check_pyflakes(args, by_lang) + failed = check_pyflakes(by_lang['py'], args) return 1 if failed else 0 @linter_config.lint diff --git a/tools/linter_lib/pyflakes.py b/tools/linter_lib/pyflakes.py index 29a9245051..91bb73f21a 100644 --- a/tools/linter_lib/pyflakes.py +++ b/tools/linter_lib/pyflakes.py @@ -31,13 +31,13 @@ def suppress_line(line: str) -> bool: return True return False -def check_pyflakes(options, by_lang): - # type: (Any, Dict[str, List[str]]) -> bool - if len(by_lang['py']) == 0: +def check_pyflakes(files, options): + # type: (List[str], Dict[str, Any]) -> bool + if len(files) == 0: return False failed = False color = next(colors) - pyflakes = subprocess.Popen(['pyflakes'] + by_lang['py'], + pyflakes = subprocess.Popen(['pyflakes'] + files, stdout=subprocess.PIPE, stderr=subprocess.PIPE) assert pyflakes.stdout is not None # Implied by use of subprocess.PIPE