changeset 26221:ae65b1b4cb46

import-checker: use modern .endswith for multiple suffixes Suggested by Anton Shestakov <engored@ya.ru> on the list. Thanks!
author Augie Fackler <augie@google.com>
date Thu, 10 Sep 2015 09:52:17 -0400
parents a43328baa2ac
children 3095b1027661
files contrib/import-checker.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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:]