commit:     320df528974c09338c7fef12e41ce66c5593c101
Author:     Etienne Buira <etienne.buira <AT> free <DOT> fr>
AuthorDate: Sat Nov  2 14:33:27 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Nov  2 15:45:49 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=320df528

gpkg: avoid os.path.islink where lstat is available

Signed-off-by: Etienne Buira <etienne.buira <AT> free.fr>
Bug: https://bugs.gentoo.org/942512
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/gpkg.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py
index 5f392e95e8..c4a2666bc5 100644
--- a/lib/portage/gpkg.py
+++ b/lib/portage/gpkg.py
@@ -1943,7 +1943,7 @@ class gpkg:
 
                 file_stat = os.lstat(f)
 
-                if os.path.islink(f):
+                if stat.S_ISLNK(file_stat):
                     path_link = os.readlink(f)
                     path_link_length = len(
                         os.fsencode(path_link)
@@ -2035,7 +2035,7 @@ class gpkg:
 
             file_stat = os.lstat(path)
 
-            if os.path.islink(path):
+            if stat.S_ISLNK(file_stat):
                 path_link = os.readlink(path)
                 path_link_length = len(
                     _unicode_encode(

Reply via email to