# HG changeset patch # User Yuya Nishihara # Date 1451227699 -32400 # Node ID 0c60843b55b5a357dea1428af2f90f57f3b8aa30 # Parent 10bed65ef209044c61f5adbabff72d0d7555474d 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. diff -r 10bed65ef209 -r 0c60843b55b5 contrib/import-checker.py --- 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