From 3a52269a1d5aad26cd6fb28b89311feec0ef76d0 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 26 Feb 2020 12:41:49 +0100 Subject: [PATCH] scripts: build.py: Handle Null path in default_python3() Change-Id: Ice6b269502a77f31a7af447429bba4332df026e9 Reviewed-by: Eike Ziller --- scripts/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.py b/scripts/build.py index 4724ece02a7..ec50a21b8e6 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -44,7 +44,9 @@ def default_python3(): path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None path = os.environ.get('PYTHON3_PATH') or path_system postfix = '.exe' if common.is_windows_platform() else '' - return existing_path(os.path.join(path, 'python3' + postfix)) or existing_path(os.path.join(path, 'python' + postfix)) + return (path if not path + else (existing_path(os.path.join(path, 'python3' + postfix)) or + existing_path(os.path.join(path, 'python' + postfix)))) def get_arguments(): parser = argparse.ArgumentParser(description='Build Qt Creator for packaging')