From 527eecae80f41965ebf6aa3847baecaa41b1158c Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 5 Jul 2022 13:42:41 +1000 Subject: [PATCH] Fallback to python3 --- src/PIL/ImageShow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageShow.py b/src/PIL/ImageShow.py index 5ca8035b1..1b2b9f05f 100644 --- a/src/PIL/ImageShow.py +++ b/src/PIL/ImageShow.py @@ -178,10 +178,11 @@ class MacViewer(Viewer): else: raise TypeError("Missing required argument: 'path'") subprocess.call(["open", "-a", "Preview.app", path]) - if sys.executable: + exectable = sys.executable or shutil.which("python3") + if executable: subprocess.Popen( [ - sys.executable, + executable, "-c", "import os, sys, time; time.sleep(20); os.remove(sys.argv[1])", path,