Fixed modified example code execution

This commit is contained in:
Luke Campagnola 2013-02-25 13:45:24 -05:00
parent b9cbf387ed
commit 4cf9ef70ba

View File

@ -154,7 +154,8 @@ class ExampleLoader(QtGui.QMainWindow):
#os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, fn, *extra)
if edited:
proc = subprocess.Popen([sys.executable, '-'] + extra, stdin=subprocess.PIPE)
path = os.path.abspath(os.path.dirname(__file__))
proc = subprocess.Popen([sys.executable, '-'] + extra, stdin=subprocess.PIPE, cwd=path)
code = str(self.ui.codeView.toPlainText()).encode('UTF-8')
proc.stdin.write(code)
proc.stdin.close()