File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ class ModuleGatherer:
4141 def __init__ (self , path = None , skiplist = None ):
4242 # The cached list of all known modules
4343 self .modules = set ()
44- # List of stored paths to compare against so that real paths are not repeated
45- # handles symlinks not mount points
44+ # List of (st_dev, st_ino) to compare against so that paths are not repeated
4645 self .paths = set ()
4746 # Patterns to skip
4847 self .skiplist = skiplist if skiplist is not None else tuple ()
@@ -187,8 +186,9 @@ def find_modules(self, path):
187186 else :
188187 if is_package :
189188 path_real = Path (pathname ).resolve ()
190- if path_real not in self .paths :
191- self .paths .add (path_real )
189+ stat = path_real .stat ()
190+ if (stat .st_dev , stat .st_ino ) not in self .paths :
191+ self .paths .add ((stat .st_dev , stat .st_ino ))
192192 for subname in self .find_modules (path_real ):
193193 if subname != "__init__" :
194194 yield f"{ name } .{ subname } "
You can’t perform that action at this time.
0 commit comments