From 0904cc3f5f0f95f6b9c3a6829e02f08ebb5bf9e7 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 18 Nov 2021 08:45:28 +0100 Subject: [PATCH] console: add error message for older Windows versions (#4911) --- mitmproxy/contrib/urwid/raw_display.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mitmproxy/contrib/urwid/raw_display.py b/mitmproxy/contrib/urwid/raw_display.py index ee6d30bdf..337c63df6 100644 --- a/mitmproxy/contrib/urwid/raw_display.py +++ b/mitmproxy/contrib/urwid/raw_display.py @@ -260,7 +260,9 @@ class Screen(BaseScreen, RealTerminal): ) 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) assert ok else: