diff --git a/CHANGELOG b/CHANGELOG index a66c79412..022c448dd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ Bug fixes / Maintenance - don't print empty lines when showing junitxml-filename - fix py.code.compile(source) to generate unique filenames - add optional boolean ignore_errors parameter to py.path.local.remove +- fix terminal writing on win32/python2.4 Changes between 1.3.0 and 1.3.1 ================================================== diff --git a/py/_io/terminalwriter.py b/py/_io/terminalwriter.py index 4a98ef69f..dc2ccf511 100644 --- a/py/_io/terminalwriter.py +++ b/py/_io/terminalwriter.py @@ -226,6 +226,8 @@ class WriteFile(object): if win32_and_ctypes: TerminalWriter = Win32ConsoleWriter + import ctypes + from ctypes import wintypes # ctypes access to the Windows console STD_OUTPUT_HANDLE = -11 @@ -242,17 +244,13 @@ if win32_and_ctypes: BACKGROUND_INTENSITY = 0x0080 # background color is intensified. def GetStdHandle(kind): - import ctypes return ctypes.windll.kernel32.GetStdHandle(kind) def SetConsoleTextAttribute(handle, attr): - import ctypes ctypes.windll.kernel32.SetConsoleTextAttribute( handle, attr) def _getdimensions(): - import ctypes - from ctypes import wintypes SHORT = ctypes.c_short class COORD(ctypes.Structure):