get this from pywin32 too

This commit is contained in:
Jean-Paul Calderone 2021-01-11 13:36:12 -05:00
parent cca0071cbf
commit 5c6e5970c9
1 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,10 @@ from win32con import (
SEM_NOOPENFILEERRORBOX,
)
from win32file import (
INVALID_HANDLE_VALUE,
)
# <https://msdn.microsoft.com/en-us/library/windows/desktop/ms687401%28v=vs.85%29.aspx>
# BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars,
# LPDWORD lpCharsWritten, LPVOID lpReserved);
@ -125,8 +129,6 @@ def initialize():
use_last_error=True
)(("GetConsoleMode", windll.kernel32))
INVALID_HANDLE_VALUE = DWORD(-1).value
def not_a_console(handle):
if handle == INVALID_HANDLE_VALUE or handle is None:
return True