From 0781f9392b9a293b09c374401be5e3ad7623db25 Mon Sep 17 00:00:00 2001 From: KIU Shueng Chuan Date: Wed, 21 Apr 2021 07:31:03 +0800 Subject: [PATCH] use Popen instead of os.spawnle --- examples/ExampleApp.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/examples/ExampleApp.py b/examples/ExampleApp.py index 3e72d24d..d5535a3b 100644 --- a/examples/ExampleApp.py +++ b/examples/ExampleApp.py @@ -360,15 +360,7 @@ class ExampleLoader(QtGui.QMainWindow): fn = self.currentFile() if fn is None: return - if sys.platform.startswith('win'): - args = [os.P_NOWAIT, sys.executable, '"'+sys.executable+'"', '"' + fn + '"'] - else: - args = [os.P_NOWAIT, sys.executable, sys.executable, fn] - if env is None: - os.spawnl(*args) - else: - args.append(env) - os.spawnle(*args) + subprocess.Popen([sys.executable, fn], env=env) def showFile(self): fn = self.currentFile()