Do not call sys.executable in PyInstaller application

This commit is contained in:
Andrew Murray 2025-06-20 23:44:30 +10:00
parent ef0bab0c65
commit f937dd27cd

View File

@ -175,7 +175,9 @@ class MacViewer(Viewer):
if not os.path.exists(path): if not os.path.exists(path):
raise FileNotFoundError raise FileNotFoundError
subprocess.call(["open", "-a", "Preview.app", path]) subprocess.call(["open", "-a", "Preview.app", path])
executable = sys.executable or shutil.which("python3")
pyinstaller = getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS")
executable = (not pyinstaller and sys.executable) or shutil.which("python3")
if executable: if executable:
subprocess.Popen( subprocess.Popen(
[ [