Skip to content

Commit

Permalink
fix: use os readlink for python 3.8 compatibility (#2582)
Browse files Browse the repository at this point in the history
- Pathlib readlink() was introduced  since Python3.9.
- I guess validation ci runs on ubuntu2004, so python version is 3.8.
- use os readlink() for python3.8 compatibility
- This PR may fix validation to
[PRs](#2578)
which use overlay functionality.

Signed-off-by: wep21 <[email protected]>
  • Loading branch information
wep21 authored Aug 11, 2024
1 parent 66da2a3 commit c37a182
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/bcr_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ def verify_module_dot_bazel(self, module_name, version):
if "overlay" in source:
overlay_dir = self.registry.get_overlay_dir(module_name, version)
module_file = overlay_dir / "MODULE.bazel"
if module_file.exists() and (
not module_file.is_symlink() or module_file.readlink().as_posix() != "../MODULE.bazel"
):
if module_file.exists() and (not module_file.is_symlink() or os.readlink(module_file) != "../MODULE.bazel"):
self.report(BcrValidationResult.FAILED, f"{module_file} should be a symlink to `../MODULE.bazel`.")

for overlay_file, expected_integrity in source["overlay"].items():
Expand Down

0 comments on commit c37a182

Please sign in to comment.