From 322a085b7022c1c571fe82213a53881503189ec7 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 31 Dec 2022 11:38:14 +0400 Subject: [PATCH] Fix the check for Native Tools Command Prompt in prepare.py --- Telegram/build/prepare/prepare.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index 1ae1aa406c..2093953193 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -12,8 +12,15 @@ def error(text): print('[ERROR] ' + text) finish(1) +def nativeToolsError(): + error('Make sure to run from Native Tools Command Prompt.') + win = (sys.platform == 'win32') mac = (sys.platform == 'darwin') + +if win and not 'Platform' in os.environ: + nativeToolsError() + win32 = win and (os.environ['Platform'] == 'x86') win64 = win and (os.environ['Platform'] == 'x64') @@ -21,7 +28,7 @@ if win and not 'COMSPEC' in os.environ: error('COMSPEC environment variable is not set.') if win and not win32 and not win64: - error('Make sure to run from Native Tools Command Prompt.') + nativeToolsError() os.chdir(scriptPath + '/../../../..')