Skip to content

Commit c564ce5

Browse files
committed
Fixing issue with pycodestyle on restricted lint.
Was an unintended side-effect of googleapis#2486.
1 parent c0eb4b5 commit c564ce5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/pycodestyle_on_repo.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"""
2020

2121

22+
from __future__ import print_function
23+
2224
import os
2325
import subprocess
2426
import sys
@@ -35,9 +37,12 @@ def main():
3537
python_files = [
3638
candidate for candidate in candidates if candidate.endswith('.py')]
3739

38-
pycodestyle_command = ['pycodestyle'] + python_files
39-
status_code = subprocess.call(pycodestyle_command)
40-
sys.exit(status_code)
40+
if not python_files:
41+
print('No Python files to lint, exiting.')
42+
else:
43+
pycodestyle_command = ['pycodestyle'] + python_files
44+
status_code = subprocess.call(pycodestyle_command)
45+
sys.exit(status_code)
4146

4247

4348
if __name__ == '__main__':

0 commit comments

Comments
 (0)