# HG changeset patch # User Yuya Nishihara # Date 1451227034 -32400 # Node ID 39845b064041aac95c2cc91c4c935f8fb95918b8 # Parent 0c60843b55b5a357dea1428af2f90f57f3b8aa30 import-checker: list package directory as stdlib module Before this patch, a directory containing __init__.py wasn't counted as a module and __init__.pyc was listed as foo.bar.__init__ module. diff -r 0c60843b55b5 -r 39845b064041 contrib/import-checker.py --- a/contrib/import-checker.py Sun Dec 27 23:48:19 2015 +0900 +++ b/contrib/import-checker.py Sun Dec 27 23:37:14 2015 +0900 @@ -179,9 +179,6 @@ # consider them stdlib. for m in ['msvcrt', '_winreg']: yield m - # These get missed too - for m in 'ctypes', 'email', 'logging', 'multiprocessing': - yield m yield 'builtins' # python3 only for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only yield m @@ -214,11 +211,12 @@ or top == libpath and d in ('hgext', 'mercurial')): del dirs[i] for name in files: - if name == '__init__.py': - continue if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')): continue - full_path = os.path.join(top, name) + if name.startswith('__init__.py'): + full_path = top + else: + full_path = os.path.join(top, name) rel_path = full_path[len(libpath) + 1:] mod = dotted_name_of_path(rel_path) yield mod