Fix opening terminal with macOS 12.3

macOS removed support for Python2, so switch to Python3 (and fix that we
now need to specify text mode for a temporary file if we want to write
text there, not binary data).

Fixes: QTCREATORBUG-27337
Change-Id: I4884480c32e017aa710f90ab0b5afe493a2adb9e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2022-04-06 10:42:54 +02:00
parent 4e59ca2bb5
commit be1437c797

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
############################################################################
#
@@ -102,7 +102,7 @@ def bash_setup(shell):
def main():
# create temporary file to be sourced into bash that deletes itself
with NamedTemporaryFile(delete=False) as shell_script:
with NamedTemporaryFile(mode='wt', delete=False) as shell_script:
shell = os.environ.get('SHELL')
shell, system_login_script, login_script, non_interactive_shell, interactive_shell = (
zsh_setup(shell) if shell is not None and shell.endswith('/zsh')