Mercurial > hg
comparison contrib/import-checker.py @ 32595:9e46627baa3c
import-checker: add hgdemandimport to local modules
This fixes test-check-module-imports.t.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 31 May 2017 20:07:08 -0700 |
parents | a025ec43856c |
children | 998fad4b3072 |
comparison
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'): |