contrib/import-checker.py
changeset 25064 3bbbadf69d0a
parent 25063 723e364488f4
child 25173 7358b5d9991e
--- a/contrib/import-checker.py	Thu May 14 01:49:10 2015 +0900
+++ b/contrib/import-checker.py	Thu May 14 01:49:10 2015 +0900
@@ -221,11 +221,14 @@
     if argv[1] == '-':
         argv = argv[:1]
         argv.extend(l.rstrip() for l in sys.stdin.readlines())
+    localmods = {}
     used_imports = {}
     any_errors = False
     for source_path in argv[1:]:
+        modname = dotted_name_of_path(source_path, trimpure=True)
+        localmods[modname] = source_path
+    for modname, source_path in sorted(localmods.iteritems()):
         f = open(source_path)
-        modname = dotted_name_of_path(source_path, trimpure=True)
         src = f.read()
         used_imports[modname] = sorted(
             imported_modules(src, ignore_nested=True))