We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e17d697 commit 294d008Copy full SHA for 294d008
1 file changed
Python/initconfig.c
@@ -295,7 +295,9 @@ _Py_can_colorize(FILE *f)
295
#if defined(MS_WINDOWS) && defined(HAVE_WINDOWS_CONSOLE_IO)
296
{
297
DWORD mode = 0;
298
- HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
+ DWORD nStdHandle = (f == stderr) ? STD_ERROR_HANDLE
299
+ : STD_OUTPUT_HANDLE;
300
+ HANDLE handle = GetStdHandle(nStdHandle);
301
if (!GetConsoleMode(handle, &mode)
302
|| !(mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING))
303
0 commit comments