contrib/import-checker.py
changeset 20383 4990abb4729d
parent 20238 81e905790b30
child 20386 a05d31b040d7
--- a/contrib/import-checker.py	Tue Jan 28 02:23:48 2014 +0100
+++ b/contrib/import-checker.py	Wed Feb 05 01:30:33 2014 +0100
@@ -11,12 +11,15 @@
 def dotted_name_of_path(path):
     """Given a relative path to a source file, return its dotted module name.
 
-
     >>> dotted_name_of_path('mercurial/error.py')
     'mercurial.error'
+    >>> dotted_name_of_path('zlibmodule.so')
+    'zlib'
     """
     parts = path.split('/')
     parts[-1] = parts[-1][:-3] # remove .py
+    if parts[-1].endswith('module'):
+        parts[-1] = parts[-1][:-6]
     return '.'.join(parts)