mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Merge pull request #6416 from bryant1410/patch-1
Fix when `sys.executable` is empty or null
This commit is contained in:
commit
14b457e15e
|
@ -178,14 +178,16 @@ class MacViewer(Viewer):
|
||||||
else:
|
else:
|
||||||
raise TypeError("Missing required argument: 'path'")
|
raise TypeError("Missing required argument: 'path'")
|
||||||
subprocess.call(["open", "-a", "Preview.app", path])
|
subprocess.call(["open", "-a", "Preview.app", path])
|
||||||
subprocess.Popen(
|
executable = sys.executable or shutil.which("python3")
|
||||||
[
|
if executable:
|
||||||
sys.executable,
|
subprocess.Popen(
|
||||||
"-c",
|
[
|
||||||
"import os, sys, time; time.sleep(20); os.remove(sys.argv[1])",
|
executable,
|
||||||
path,
|
"-c",
|
||||||
]
|
"import os, sys, time; time.sleep(20); os.remove(sys.argv[1])",
|
||||||
)
|
path,
|
||||||
|
]
|
||||||
|
)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user