diff --git a/lib/codegen/meta-python/gen_build_deps.py b/lib/codegen/meta-python/gen_build_deps.py index 03d9ee72d0..8423e72060 100644 --- a/lib/codegen/meta-python/gen_build_deps.py +++ b/lib/codegen/meta-python/gen_build_deps.py @@ -22,22 +22,11 @@ except ImportError: pass -def source_files(top): - # type: (str) -> Iterable[str] - """ - Recursively find all interesting source files and directories in the - directory tree starting at top. Yield a path to each file. - """ - for (dirpath, dirnames, filenames) in os.walk(top): - yield dirpath - for f in filenames: - if f.endswith('.py'): - yield join(dirpath, f) - - def generate(): # type: () -> None print("Dependencies from meta language directory:") meta = dirname(abspath(__file__)) - for path in source_files(meta): - print("cargo:rerun-if-changed=" + path) + for (dirpath, _, filenames) in os.walk(meta): + for f in filenames: + if f.endswith('.py'): + print("cargo:rerun-if-changed=" + join(dirpath, f))