Skip to content

Commit 7a1718b

Browse files
committed
Exclude the pycache dir instead of the pyc files
1 parent 4bb41b2 commit 7a1718b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tools/jit/_targets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def _compute_digest(self) -> str:
7171
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
7272
hasher.update((self.pyconfig_dir / "pyconfig.h").read_bytes())
7373
for dirpath, _, filenames in sorted(os.walk(TOOLS_JIT)):
74+
# Exclude cache files from digest computation to ensure reproducible builds.
75+
if dirpath.endswith("__pycache__"):
76+
continue
7477
for filename in filenames:
75-
# Exclude .pyc files from digest computation to ensure reproducible builds.
76-
if filename.endswith(".pyc"):
77-
continue
7878
hasher.update(pathlib.Path(dirpath, filename).read_bytes())
7979
return hasher.hexdigest()
8080

0 commit comments

Comments
 (0)