scripts: build.py: Handle Null path in default_python3()

Change-Id: Ice6b269502a77f31a7af447429bba4332df026e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2020-02-26 12:41:49 +01:00
parent c3c5708741
commit 3a52269a1d

View File

@@ -44,7 +44,9 @@ def default_python3():
path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None path_system = os.path.join('/usr', 'bin') if not common.is_windows_platform() else None
path = os.environ.get('PYTHON3_PATH') or path_system path = os.environ.get('PYTHON3_PATH') or path_system
postfix = '.exe' if common.is_windows_platform() else '' 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(): def get_arguments():
parser = argparse.ArgumentParser(description='Build Qt Creator for packaging') parser = argparse.ArgumentParser(description='Build Qt Creator for packaging')