From cb1dbcc44b105f3deadc99f0b79b7711bc0ff6d3 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Dec 21 2022 11:18:48 +0000 Subject: Add Python 2.7 support to clamp_source_mtime.py This script is also invoked with Python 2 --- diff --git a/clamp_source_mtime.py b/clamp_source_mtime.py index 7349ea3..1d03a6b 100644 --- a/clamp_source_mtime.py +++ b/clamp_source_mtime.py @@ -10,6 +10,7 @@ License: This has been derived from the Python's compileall module and it follows Python licensing. For more info see: https://www.python.org/psf/license/ """ +from __future__ import print_function import os import sys @@ -41,8 +42,9 @@ def _walk_dir(dir, maxlevels, quiet=0): yield fullname elif (maxlevels > 0 and name != os.curdir and name != os.pardir and os.path.isdir(fullname) and not os.path.islink(fullname)): - yield from _walk_dir(fullname, maxlevels=maxlevels - 1, - quiet=quiet) + for result in _walk_dir(fullname, maxlevels=maxlevels - 1, + quiet=quiet): + yield result def clamp_dir(dir, source_date_epoch, quiet=0):