import-checker: accept .pyc and .pyo files (issue4812)
authortimeless@mozdev.org
Wed, 02 Sep 2015 16:07:35 -0400
changeset 26166 bb6936bec727
parent 26165 927c0d84e09f
child 26167 7187f6e923d5
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
contrib/import-checker.py
--- a/contrib/import-checker.py	Tue Sep 01 21:37:51 2015 +0200
+++ b/contrib/import-checker.py	Wed Sep 02 16:07:35 2015 -0400
@@ -200,7 +200,10 @@
             for name in files:
                 if name == '__init__.py':
                     continue
-                if not (name.endswith('.py') or name.endswith('.so')
+                if not (name.endswith('.py')
+                        or name.endswith('.so')
+                        or name.endswith('.pyc')
+                        or name.endswith('.pyo')
                         or name.endswith('.pyd')):
                     continue
                 full_path = os.path.join(top, name)