(path)
| 37 | else: |
| 38 | HAVE_GETSHORTPATHNAME = True |
| 39 | def _getshortpathname(path): |
| 40 | GSPN = ctypes.WinDLL("kernel32", use_last_error=True).GetShortPathNameW |
| 41 | GSPN.argtypes = [ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_uint32] |
| 42 | GSPN.restype = ctypes.c_uint32 |
| 43 | result_len = GSPN(path, None, 0) |
| 44 | if not result_len: |
| 45 | raise OSError("failed to get short path name 0x{:08X}" |
| 46 | .format(ctypes.get_last_error())) |
| 47 | result = ctypes.create_unicode_buffer(result_len) |
| 48 | result_len = GSPN(path, result, result_len) |
| 49 | return result[:result_len] |
| 50 | |
| 51 | def _norm(path): |
| 52 | if isinstance(path, (bytes, str, os.PathLike)): |
no test coverage detected
searching dependent graphs…