Fix when sys.executable is empty or null

This commit is contained in:
Santiago Castro 2022-07-04 09:50:47 -07:00 committed by GitHub
parent 26e2c7e030
commit a0b22d2203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,14 +178,15 @@ class MacViewer(Viewer):
else:
raise TypeError("Missing required argument: 'path'")
subprocess.call(["open", "-a", "Preview.app", path])
subprocess.Popen(
[
sys.executable,
"-c",
"import os, sys, time; time.sleep(20); os.remove(sys.argv[1])",
path,
]
)
if sys.executable:
subprocess.Popen(
[
sys.executable,
"-c",
"import os, sys, time; time.sleep(20); os.remove(sys.argv[1])",
path,
]
)
return 1