# HG changeset patch # User Mads Kiilerich # Date 2014-02-07 01:59:46 # Node ID 466e4c574db0ca1faf699fa1139423fd7c85a1c3 # Parent 3fedc29a98bb2fa46669b2cf1ba4e209da6685ed import-checker: handle standard modules with arch in the filename Installations with module names like /usr/lib/python2.7/lib-dynload/bz2.x86_64-linux-gnu.so occurs in the wild. Let's just ignore everything after first '.' when guessing the Python module name. diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -17,7 +17,7 @@ def dotted_name_of_path(path): 'zlib' """ parts = path.split('/') - parts[-1] = parts[-1][:-3] # remove .py + parts[-1] = parts[-1].split('.', 1)[0] # remove .py and .so and .ARCH.so if parts[-1].endswith('module'): parts[-1] = parts[-1][:-6] return '.'.join(parts)