From 1cef7cd8b00d336a4d1d742855dc8ce74f410c38 Mon Sep 17 00:00:00 2001
From: Serhiy Storchaka <storchaka@gmail.com>
Date: Fri, 5 Jan 2024 21:50:48 +0200
Subject: [PATCH] Revert "Test also the hidden flag for symlink target."

This reverts commit 59ee5f35683a8756d0618e4c39fddac9843c78aa.
---
 Lib/site.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/Lib/site.py b/Lib/site.py
index a40d06ff3e293d..efc1f046787ec2 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -177,6 +177,7 @@ def addpackage(sitedir, name, known_paths):
         (getattr(st, 'st_file_attributes', 0) & stat.FILE_ATTRIBUTE_HIDDEN)):
         _trace(f"Skipping hidden .pth file: {fullname!r}")
         return
+    _trace(f"Processing .pth file: {fullname!r}")
     try:
         # locale encoding is not ideal especially on Windows. But we have used
         # it for a long time. setuptools uses the locale encoding too.
@@ -184,15 +185,6 @@ def addpackage(sitedir, name, known_paths):
     except OSError:
         return
     with f:
-        if stat.S_ISLNK(st.st_mode) and hasattr(st, 'st_flags'):
-            try:
-                st = os.fstat(f.fileno())
-            except OSError:
-                return
-            if st.st_flags & stat.UF_HIDDEN:
-                _trace(f"Skipping hidden .pth file: {fullname!r}")
-                return
-        _trace(f"Processing .pth file: {fullname!r}")
         for n, line in enumerate(f):
             if line.startswith("#"):
                 continue