mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Remove some unnecessary checks and fix tests: UnicodeType isn't available in Python 3.2
This commit is contained in:
@@ -82,16 +82,15 @@ except ImportError:
|
||||
|
||||
|
||||
def convert_to_long_pathname(filename):
|
||||
if sys.platform != "win32":
|
||||
return filename
|
||||
else:
|
||||
if CTYPES_AVAILABLE:
|
||||
buf = ctypes.create_unicode_buffer(260)
|
||||
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
|
||||
rv = GetLongPathName(types.UnicodeType(filename), buf, 260)
|
||||
if rv != 0 and rv <= 260:
|
||||
return buf.value.encode(getfilesystemencoding())
|
||||
return filename
|
||||
if CTYPES_AVAILABLE:
|
||||
buf = ctypes.create_unicode_buffer(260)
|
||||
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
|
||||
if IS_PY2:
|
||||
filename = unicode(filename)
|
||||
rv = GetLongPathName(filename, buf, 260)
|
||||
if rv != 0 and rv <= 260:
|
||||
return buf.value.encode(getfilesystemencoding())
|
||||
return filename
|
||||
|
||||
|
||||
def norm_case(filename):
|
||||
|
||||
Reference in New Issue
Block a user