comparison contrib/import-checker.py @ 26166:bb6936bec727

import-checker: accept .pyc and .pyo files (issue4812) Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin $ ls '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6'/BaseHTTPServer.py* /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.pyc /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.pyo
author timeless@mozdev.org
date Wed, 02 Sep 2015 16:07:35 -0400
parents 7154a4a08b96
children ae65b1b4cb46
comparison
equal deleted inserted replaced
26165:927c0d84e09f 26166:bb6936bec727
198 or top == libpath and d in ('hgext', 'mercurial')): 198 or top == libpath and d in ('hgext', 'mercurial')):
199 del dirs[i] 199 del dirs[i]
200 for name in files: 200 for name in files:
201 if name == '__init__.py': 201 if name == '__init__.py':
202 continue 202 continue
203 if not (name.endswith('.py') or name.endswith('.so') 203 if not (name.endswith('.py')
204 or name.endswith('.so')
205 or name.endswith('.pyc')
206 or name.endswith('.pyo')
204 or name.endswith('.pyd')): 207 or name.endswith('.pyd')):
205 continue 208 continue
206 full_path = os.path.join(top, name) 209 full_path = os.path.join(top, name)
207 rel_path = full_path[len(libpath) + 1:] 210 rel_path = full_path[len(libpath) + 1:]
208 mod = dotted_name_of_path(rel_path) 211 mod = dotted_name_of_path(rel_path)