Mercurial > public > mercurial-scm > hg
diff contrib/import-checker.py @ 20391:466e4c574db0
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.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 07 Feb 2014 02:59:46 +0100 |
parents | a05d31b040d7 |
children | 6bd43614d387 |
line wrap: on
line diff
--- a/contrib/import-checker.py Mon Feb 03 20:08:58 2014 +0100 +++ b/contrib/import-checker.py Fri Feb 07 02:59:46 2014 +0100 @@ -17,7 +17,7 @@ '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)