Skip to content

Commit

Permalink
drop readlink, since it was introduced in 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rgildein committed Jan 11, 2024
1 parent 2cb6a04 commit c3fc03e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def find_packages_by_indices(indices, base=""):
def _get_archive_root(pool: Path) -> Path:
"""Get archive path from pool path."""
if pool.is_symlink():
return pool.readlink().parent.absolute()
# Note(rgildein): using pool.resolve instead of pool.readlink, since readlink was
# introduced in Python 3.9, we know that path exists, so it's safe
return pool.resolve().parent.absolute()

return pool.parent.absolute()

Expand Down

0 comments on commit c3fc03e

Please sign in to comment.