Fix for colorama bug:

https://code.google.com/p/colorama/issues/detail?id=47
This commit is contained in:
Luke Campagnola 2014-03-25 19:17:11 -04:00
parent 2ce6196ac0
commit 604ea49477

View File

@ -12,7 +12,7 @@ except ImportError:
SetConsoleTextAttribute = lambda *_: None SetConsoleTextAttribute = lambda *_: None
else: else:
from ctypes import ( from ctypes import (
byref, Structure, c_char, c_short, c_uint32, c_ushort, POINTER byref, Structure, c_char, c_short, c_int, c_uint32, c_ushort, c_void_p, POINTER
) )
class CONSOLE_SCREEN_BUFFER_INFO(Structure): class CONSOLE_SCREEN_BUFFER_INFO(Structure):
@ -42,7 +42,8 @@ else:
_GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo
_GetConsoleScreenBufferInfo.argtypes = [ _GetConsoleScreenBufferInfo.argtypes = [
wintypes.HANDLE, wintypes.HANDLE,
POINTER(CONSOLE_SCREEN_BUFFER_INFO), c_void_p,
#POINTER(CONSOLE_SCREEN_BUFFER_INFO),
] ]
_GetConsoleScreenBufferInfo.restype = wintypes.BOOL _GetConsoleScreenBufferInfo.restype = wintypes.BOOL
@ -56,7 +57,8 @@ else:
_SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition
_SetConsoleCursorPosition.argtypes = [ _SetConsoleCursorPosition.argtypes = [
wintypes.HANDLE, wintypes.HANDLE,
wintypes._COORD, c_int,
#wintypes._COORD,
] ]
_SetConsoleCursorPosition.restype = wintypes.BOOL _SetConsoleCursorPosition.restype = wintypes.BOOL
@ -75,7 +77,8 @@ else:
wintypes.HANDLE, wintypes.HANDLE,
wintypes.WORD, wintypes.WORD,
wintypes.DWORD, wintypes.DWORD,
wintypes._COORD, c_int,
#wintypes._COORD,
POINTER(wintypes.DWORD), POINTER(wintypes.DWORD),
] ]
_FillConsoleOutputAttribute.restype = wintypes.BOOL _FillConsoleOutputAttribute.restype = wintypes.BOOL