From c3fc03e6b2b76a139f33e1869e6f2a0fc9b6bb25 Mon Sep 17 00:00:00 2001 From: Robert Gildein Date: Thu, 11 Jan 2024 20:08:26 +0100 Subject: [PATCH] drop readlink, since it was introduced in 3.9 --- src/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index e29a955..0791906 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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()