contrib/import-checker.py
changeset 32595 9e46627baa3c
parent 32509 a025ec43856c
child 33876 998fad4b3072
equal deleted inserted replaced
32594:517841766994 32595:9e46627baa3c
   242         if not any(libpath.startswith(p) for p in stdlib_prefixes):
   242         if not any(libpath.startswith(p) for p in stdlib_prefixes):
   243             continue
   243             continue
   244         for top, dirs, files in os.walk(libpath):
   244         for top, dirs, files in os.walk(libpath):
   245             for i, d in reversed(list(enumerate(dirs))):
   245             for i, d in reversed(list(enumerate(dirs))):
   246                 if (not os.path.exists(os.path.join(top, d, '__init__.py'))
   246                 if (not os.path.exists(os.path.join(top, d, '__init__.py'))
   247                     or top == libpath and d in ('hgext', 'mercurial')):
   247                     or top == libpath and d in ('hgdemandimport', 'hgext',
       
   248                                                 'mercurial')):
   248                     del dirs[i]
   249                     del dirs[i]
   249             for name in files:
   250             for name in files:
   250                 if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')):
   251                 if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')):
   251                     continue
   252                     continue
   252                 if name.startswith('__init__.py'):
   253                 if name.startswith('__init__.py'):