Skip to content

Commit 204aa59

Browse files
authored
Merge pull request #172 from jinchengJL/fix_path_readlink_before_python_39
Fix: Use os.readlink instead of Path.readlink before Python 3.9.
2 parents 33658ba + dd0219a commit 204aa59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refresh.template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ def _ensure_external_workspaces_link_exists():
13051305
# This seemed to be the cleanest way to detect both.
13061306
# Note that os.path.islink doesn't detect junctions.
13071307
try:
1308-
current_dest = source.readlink() # MIN_PY=3.9 source.readlink()
1308+
current_dest = pathlib.Path(os.readlink(source)) # MIN_PY=3.9 source.readlink()
13091309
except OSError:
13101310
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.
13111311
sys.exit(1)

0 commit comments

Comments
 (0)