From a2cc296ec9fd4eb2f9925e0258e009bbb45e4bb2 Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Tue, 1 Nov 2016 22:51:43 -0400 Subject: [PATCH] Fix pycodestyle failing when removing files from repo. --- scripts/pycodestyle_on_repo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/pycodestyle_on_repo.py b/scripts/pycodestyle_on_repo.py index b362dae0c6f9..a07f3fed9e75 100644 --- a/scripts/pycodestyle_on_repo.py +++ b/scripts/pycodestyle_on_repo.py @@ -37,6 +37,9 @@ def main(): python_files = [ candidate for candidate in candidates if candidate.endswith('.py')] + python_files = [ + candidate for candidate in python_files if os.path.isfile(candidate)] + if not python_files: print('No Python files to lint, exiting.') else: