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,