Fix winpaths' call to wintypes in py3k

This commit is contained in:
2018-10-08 11:20:45 -05:00
parent 17bc40c920
commit b0e02c831a
2 changed files with 16 additions and 0 deletions

12
src/fixes/fix_winpaths.py Normal file
View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import ctypes
import winpaths
from ctypes import wintypes
def _get_path_buf(csidl):
path_buf = ctypes.create_unicode_buffer(wintypes.MAX_PATH)
result = winpaths._SHGetFolderPath(0, csidl, 0, 0, path_buf)
return path_buf.value
def fix():
winpaths._get_path_buf = _get_path_buf