import-checker: use modern .endswith for multiple suffixes
authorAugie Fackler <augie@google.com>
Thu, 10 Sep 2015 09:52:17 -0400
changeset 26221 ae65b1b4cb46
parent 26220 a43328baa2ac
child 26222 3095b1027661
import-checker: use modern .endswith for multiple suffixes Suggested by Anton Shestakov <engored@ya.ru> on the list. Thanks!
contrib/import-checker.py
--- a/contrib/import-checker.py	Sat Aug 22 18:43:24 2015 -0700
+++ b/contrib/import-checker.py	Thu Sep 10 09:52:17 2015 -0400
@@ -200,11 +200,7 @@
             for name in files:
                 if name == '__init__.py':
                     continue
-                if not (name.endswith('.py')
-                        or name.endswith('.so')
-                        or name.endswith('.pyc')
-                        or name.endswith('.pyo')
-                        or name.endswith('.pyd')):
+                if not name.endswith(('.py', '.so', '.pyc', '.pyo', '.pyd')):
                     continue
                 full_path = os.path.join(top, name)
                 rel_path = full_path[len(libpath) + 1:]