mirror of
https://github.com/python/cpython.git
synced 2026-05-09 03:50:56 +00:00
Check if Windows is using stdout/stderr
This commit is contained in:
parent
e17d6971a0
commit
294d00827f
1 changed files with 3 additions and 1 deletions
|
|
@ -295,7 +295,9 @@ _Py_can_colorize(FILE *f)
|
|||
#if defined(MS_WINDOWS) && defined(HAVE_WINDOWS_CONSOLE_IO)
|
||||
{
|
||||
DWORD mode = 0;
|
||||
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
DWORD nStdHandle = (f == stderr) ? STD_ERROR_HANDLE
|
||||
: STD_OUTPUT_HANDLE;
|
||||
HANDLE handle = GetStdHandle(nStdHandle);
|
||||
if (!GetConsoleMode(handle, &mode)
|
||||
|| !(mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue