console: add error message for older Windows versions (#4911)

This commit is contained in:
Maximilian Hils 2021-11-18 08:45:28 +01:00 committed by GitHub
parent 888ce66f90
commit 0904cc3f5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,9 @@ class Screen(BaseScreen, RealTerminal):
) )
ok = win32.SetConsoleMode(hOut, dwOutMode) ok = win32.SetConsoleMode(hOut, dwOutMode)
assert ok if not ok:
raise RuntimeError("Error enabling virtual terminal processing, "
"mitmproxy's console interface requires Windows 10 Build 10586 or above.")
ok = win32.SetConsoleMode(hIn, dwInMode) ok = win32.SetConsoleMode(hIn, dwInMode)
assert ok assert ok
else: else: