Skip to content

Commit

Permalink
Merge pull request #172 from jinchengJL/fix_path_readlink_before_pyth…
Browse files Browse the repository at this point in the history
…on_39

Fix: Use os.readlink instead of Path.readlink before Python 3.9.
  • Loading branch information
cpsauer committed Feb 22, 2024
2 parents 33658ba + dd0219a commit 204aa59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion refresh.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ def _ensure_external_workspaces_link_exists():
# This seemed to be the cleanest way to detect both.
# Note that os.path.islink doesn't detect junctions.
try:
current_dest = source.readlink() # MIN_PY=3.9 source.readlink()
current_dest = pathlib.Path(os.readlink(source)) # MIN_PY=3.9 source.readlink()
except OSError:
log_error(f">>> //external already exists, but it isn't a {'junction' if is_windows else 'symlink'}. //external is reserved by Bazel and needed for this tool. Please rename or delete your existing //external and rerun. More details in the README if you want them.") # Don't auto delete in case the user has something important there.
sys.exit(1)
Expand Down

0 comments on commit 204aa59

Please sign in to comment.