contrib/import-checker.py
branchstable
changeset 47801 42e2cdb50db0
parent 47377 26127236b229
child 48834 029b76d645dc
equal deleted inserted replaced
47800:6802422a1ae0 47801:42e2cdb50db0
   276         if os.path.abspath(libpath).startswith(sourceroot) or not any(
   276         if os.path.abspath(libpath).startswith(sourceroot) or not any(
   277             libpath.startswith(p) for p in stdlib_prefixes
   277             libpath.startswith(p) for p in stdlib_prefixes
   278         ):
   278         ):
   279             continue
   279             continue
   280         for top, dirs, files in os.walk(libpath):
   280         for top, dirs, files in os.walk(libpath):
       
   281             if 'dist-packages' in top.split(os.path.sep):
       
   282                 continue
   281             for i, d in reversed(list(enumerate(dirs))):
   283             for i, d in reversed(list(enumerate(dirs))):
   282                 if (
   284                 if (
   283                     not os.path.exists(os.path.join(top, d, '__init__.py'))
   285                     not os.path.exists(os.path.join(top, d, '__init__.py'))
   284                     or top == libpath
   286                     or top == libpath
   285                     and d in ('hgdemandimport', 'hgext', 'mercurial')
   287                     and d in ('hgdemandimport', 'hgext', 'mercurial')