diff --git a/contrib/import-checker.py b/contrib/import-checker.py index a82de9dc4f773422b23ed6c79472a5d55e49bf83_Y29udHJpYi9pbXBvcnQtY2hlY2tlci5weQ==..4990abb4729d71acedb92bda7ae84909ef98a1ba_Y29udHJpYi9pbXBvcnQtY2hlY2tlci5weQ== 100644 --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -11,6 +11,5 @@ 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' @@ -15,5 +14,7 @@ >>> 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 @@ -17,6 +18,8 @@ """ parts = path.split('/') parts[-1] = parts[-1][:-3] # remove .py + if parts[-1].endswith('module'): + parts[-1] = parts[-1][:-6] return '.'.join(parts)