From 3202a5f081bc4c91d8396affe5b9fab3b5a3f5b1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 Sep 2021 16:50:44 +0300 Subject: [PATCH] Fix prepare getch for macOS. --- Telegram/build/prepare/prepare.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index 629e448303..b198b605ba 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -297,7 +297,7 @@ class _GetchWindows: def __call__(self): import msvcrt - return msvcrt.getch() + return msvcrt.getch().decode('ascii') getch = _Getch() @@ -342,16 +342,16 @@ def runStages(): else: print('(r)ebuild, rebuild (a)ll, (s)kip, (q)uit?: ', end='', flush=True) while True: - ch = b'r' if rebuildStale else getch() - if ch == b'q': + ch = 'r' if rebuildStale else getch() + if ch == 'q': finish(0) - elif ch == b's': + elif ch == 's': checkResult = 'Skip' break - elif ch == b'r': + elif ch == 'r': checkResult = 'Rebuild' break - elif ch == b'a': + elif ch == 'a': checkResult = 'Rebuild' rebuildStale = True break