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: