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:
41
41
def __init__ (self , path = None , skiplist = None ):
42
42
# The cached list of all known modules
43
43
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
46
45
self .paths = set ()
47
46
# Patterns to skip
48
47
self .skiplist = skiplist if skiplist is not None else tuple ()
@@ -187,8 +186,9 @@ def find_modules(self, path):
187
186
else :
188
187
if is_package :
189
188
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 ))
192
192
for subname in self .find_modules (path_real ):
193
193
if subname != "__init__" :
194
194
yield f"{ name } .{ subname } "
You can’t perform that action at this time.
0 commit comments