select the correct python_command for pyinstaller builds, even on not-Windows

Checking the executable basename sort of works, at least for Windows,
since Windows always happens to use exactly this approach. However, the
official pyinstaller documentation suggests a very different approach:

https://pyinstaller.org/en/stable/runtime-information.html

This approach is more robust since it works on any OS, and in particular
it allows me to test the PyInstaller bundle functionality on Linux, even
though we don't officially distribute it as such.
pull/11659/head
Eli Schwartz 2 years ago committed by Jussi Pakkanen
parent e66b07e6fb
commit c39ee881a1
  1. 4
      mesonbuild/utils/universal.py

@ -176,8 +176,8 @@ project_meson_versions = collections.defaultdict(str) # type: T.DefaultDict[str
from glob import glob
if os.path.basename(sys.executable) == 'meson.exe':
# In Windows and using the MSI installed executable.
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
# using a PyInstaller bundle, e.g. the MSI installed executable
python_command = [sys.executable, 'runpython']
else:
python_command = [sys.executable]

Loading…
Cancel
Save