diff options
Diffstat (limited to 'platform_utils_win32.py')
-rw-r--r-- | platform_utils_win32.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform_utils_win32.py b/platform_utils_win32.py index 31e00c17..b5c21fe0 100644 --- a/platform_utils_win32.py +++ b/platform_utils_win32.py | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | import errno | 17 | import errno |
18 | 18 | ||
19 | from pyversion import is_python3 | ||
19 | from ctypes import WinDLL, get_last_error, FormatError, WinError, addressof | 20 | from ctypes import WinDLL, get_last_error, FormatError, WinError, addressof |
20 | from ctypes import c_buffer | 21 | from ctypes import c_buffer |
21 | from ctypes.wintypes import BOOL, BOOLEAN, LPCWSTR, DWORD, HANDLE, POINTER, c_ubyte | 22 | from ctypes.wintypes import BOOL, BOOLEAN, LPCWSTR, DWORD, HANDLE, POINTER, c_ubyte |
@@ -208,6 +209,10 @@ def readlink(path): | |||
208 | 209 | ||
209 | def _preserve_encoding(source, target): | 210 | def _preserve_encoding(source, target): |
210 | """Ensures target is the same string type (i.e. unicode or str) as source.""" | 211 | """Ensures target is the same string type (i.e. unicode or str) as source.""" |
212 | |||
213 | if is_python3(): | ||
214 | return target | ||
215 | |||
211 | if isinstance(source, unicode): | 216 | if isinstance(source, unicode): |
212 | return unicode(target) | 217 | return unicode(target) |
213 | return str(target) | 218 | return str(target) |