Mercurial > hg
changeset 27620:0c60843b55b5
import-checker: normalize directory separator to get module name on Windows
It didn't work if a path contains "\\". Therefore, ctypes.util couldn't be
found on Windows.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 27 Dec 2015 23:48:19 +0900 |
parents | 10bed65ef209 |
children | 39845b064041 |
files | contrib/import-checker.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/import-checker.py Sat Jan 02 11:47:07 2016 -0800 +++ b/contrib/import-checker.py Sun Dec 27 23:48:19 2015 +0900 @@ -61,7 +61,7 @@ >>> dotted_name_of_path('zlibmodule.so') 'zlib' """ - parts = path.split('/') + parts = path.replace(os.sep, '/').split('/') parts[-1] = parts[-1].split('.', 1)[0] # remove .py and .so and .ARCH.so if parts[-1].endswith('module'): parts[-1] = parts[-1][:-6] @@ -180,7 +180,7 @@ for m in ['msvcrt', '_winreg']: yield m # These get missed too - for m in 'ctypes', 'ctypes.util', 'email', 'logging', 'multiprocessing': + for m in 'ctypes', 'email', 'logging', 'multiprocessing': yield m yield 'builtins' # python3 only for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only