##// END OF EJS Templates
import-checker: list package directory as stdlib module...
Yuya Nishihara -
r27621:39845b06 default
parent child Browse files
Show More
@@ -179,9 +179,6 b' def list_stdlib_modules():'
179 # consider them stdlib.
179 # consider them stdlib.
180 for m in ['msvcrt', '_winreg']:
180 for m in ['msvcrt', '_winreg']:
181 yield m
181 yield m
182 # These get missed too
183 for m in 'ctypes', 'email', 'logging', 'multiprocessing':
184 yield m
185 yield 'builtins' # python3 only
182 yield 'builtins' # python3 only
186 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only
183 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only
187 yield m
184 yield m
@@ -214,11 +211,12 b' def list_stdlib_modules():'
214 or top == libpath and d in ('hgext', 'mercurial')):
211 or top == libpath and d in ('hgext', 'mercurial')):
215 del dirs[i]
212 del dirs[i]
216 for name in files:
213 for name in files:
217 if name == '__init__.py':
218 continue
219 if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')):
214 if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')):
220 continue
215 continue
221 full_path = os.path.join(top, name)
216 if name.startswith('__init__.py'):
217 full_path = top
218 else:
219 full_path = os.path.join(top, name)
222 rel_path = full_path[len(libpath) + 1:]
220 rel_path = full_path[len(libpath) + 1:]
223 mod = dotted_name_of_path(rel_path)
221 mod = dotted_name_of_path(rel_path)
224 yield mod
222 yield mod
General Comments 0
You need to be logged in to leave comments. Login now