Python: Remove deprecated uses of os.popen

T40415 by Lawrence D'Oliveiro
This commit is contained in:
Campbell Barton
2014-06-20 01:57:06 +10:00
parent eaac6cbcd9
commit 2dce13d213
5 changed files with 26 additions and 24 deletions

View File

@@ -802,13 +802,14 @@ class WM_OT_path_open(Operator):
if sys.platform[:3] == "win":
os.startfile(filepath)
elif sys.platform == "darwin":
subprocess.Popen(["open", filepath])
subprocess.check_call(["open", filepath])
else:
try:
subprocess.Popen(["xdg-open", filepath])
except OSError:
subprocess.check_call(["xdg-open", filepath])
except:
# xdg-open *should* be supported by recent Gnome, KDE, Xfce
pass
import traceback
traceback.print_exc()
return {'FINISHED'}