Skip to content

Commit 6aa6a58

Browse files
committed
Merge pull request #195 from cbrentharris/apply-fix-edits
Use Python's builtin os.walk in utils/apply-fixit-edits.py
2 parents 7245c07 + 6d49ef9 commit 6aa6a58

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

utils/apply-fixit-edits.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
import json
1818
import argparse
1919
import sys
20+
import os
2021

2122
def find_remap_files(path):
22-
out = None
23-
try:
24-
out = subprocess.check_output(["find", path, "-name", "*.remap"])
25-
except subprocess.CalledProcessError:
26-
return None
27-
lines = out.split('\n')
28-
lines.pop(-1)
29-
return lines
23+
for root, dirs, files in os.walk(path):
24+
for filename in files:
25+
if not filename.endswith(".remap"):
26+
continue
27+
yield os.path.join(root, filename)
3028

3129
def apply_edits(path):
3230
remap_files = find_remap_files(path)

0 commit comments

Comments
 (0)