Fix winpaths' call to wintypes in py3k
This commit is contained in:
parent
17bc40c920
commit
b0e02c831a
12
src/fixes/fix_winpaths.py
Normal file
12
src/fixes/fix_winpaths.py
Normal 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
|
@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals # at top of module
|
||||
# this is the first fix we have to import just before the paths module would.
|
||||
# it changes a call from wintypes to ctypes.
|
||||
from fixes import fix_winpaths
|
||||
fix_winpaths.fix()
|
||||
import os
|
||||
import logging
|
||||
import storage
|
||||
|
Loading…
Reference in New Issue
Block a user