Skip to content

Commit 4177eff

Browse files
committed
general cleaning up
1 parent fbf528f commit 4177eff

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

‎Tools/scripts/patchcheck.py‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,14 @@ def call_fxn(*args, **kwargs):
3636
def changed_files():
3737
"""Get the list of changed or added files from the VCS."""
3838
if os.path.isdir('.hg'):
39-
vcs = 'hg'
4039
cmd = 'hg status --added --modified --no-status'
4140
else:
4241
sys.exit('need a checkout to get modified files')
4342

4443
st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
4544
try:
4645
st.wait()
47-
if vcs == 'hg':
48-
return [x.decode().rstrip() for x in st.stdout]
49-
else:
50-
output = (x.decode().rstrip().rsplit(None, 1)[-1]
51-
for x in st.stdout if x[0] in b'AM')
52-
return set(path for path in output if os.path.isfile(path))
46+
return [x.decode().rstrip() for x in st.stdout]
5347
finally:
5448
st.stdout.close()
5549

@@ -69,10 +63,8 @@ def report_modified_files(file_paths):
6963
def normalize_whitespace(file_paths):
7064
"""Make sure that the whitespace for .py files have been normalized."""
7165
reindent.makebackup = False # No need to create backups.
72-
fixed = []
73-
for path in (x for x in file_paths if x.endswith('.py')):
74-
if reindent.check(path):
75-
fixed.append(path)
66+
fixed = [path for path in file_paths if path.endswith('.py') and
67+
reindent.check(path)]
7668
return fixed
7769

7870

0 commit comments

Comments
 (0)