##// END OF EJS Templates
import-checker: recurse into subtree of sys.path only if __init__.py exists...
Yuya Nishihara -
r25733:f99c066f default
parent child Browse files
Show More
@@ -195,6 +195,9 b' def list_stdlib_modules():'
195 if 'site-packages' in libpath:
195 if 'site-packages' in libpath:
196 continue
196 continue
197 for top, dirs, files in os.walk(libpath):
197 for top, dirs, files in os.walk(libpath):
198 for i, d in reversed(list(enumerate(dirs))):
199 if not os.path.exists(os.path.join(top, d, '__init__.py')):
200 del dirs[i]
198 for name in files:
201 for name in files:
199 if name == '__init__.py':
202 if name == '__init__.py':
200 continue
203 continue
@@ -202,8 +205,6 b' def list_stdlib_modules():'
202 or name.endswith('.pyd')):
205 or name.endswith('.pyd')):
203 continue
206 continue
204 full_path = os.path.join(top, name)
207 full_path = os.path.join(top, name)
205 if 'site-packages' in full_path:
206 continue
207 rel_path = full_path[len(libpath) + 1:]
208 rel_path = full_path[len(libpath) + 1:]
208 mod = dotted_name_of_path(rel_path)
209 mod = dotted_name_of_path(rel_path)
209 yield mod
210 yield mod
General Comments 0
You need to be logged in to leave comments. Login now