Skip to content

Fix: Use os.readlink instead of Path.readlink before Python 3.9. #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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