mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-28 17:03:13 +03:00
Fix when sys.executable
is empty or null
This commit is contained in:
parent
26e2c7e030
commit
a0b22d2203
|
@ -178,14 +178,15 @@ 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(
|
if sys.executable:
|
||||||
[
|
subprocess.Popen(
|
||||||
sys.executable,
|
[
|
||||||
"-c",
|
sys.executable,
|
||||||
"import os, sys, time; time.sleep(20); os.remove(sys.argv[1])",
|
"-c",
|
||||||
path,
|
"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