Altered pOpen patch to use sys.executable instead of os.environ['_']

This commit is contained in:
Joe Gregorio 2006-09-30 10:14:07 -04:00
parent c00ddec9a9
commit 9dbc6b5dbe

View File

@ -1,5 +1,5 @@
from subprocess import Popen, PIPE
import os
import sys
def run(script, doc, output_file=None, options={}):
""" process an Python script """
@ -11,8 +11,7 @@ def run(script, doc, output_file=None, options={}):
options = sum([['--'+key, value] for key,value in options.items()], [])
python = os.environ.get('_', 'python')
proc = Popen([python, script] + options,
proc = Popen([sys.executable, script] + options,
stdin=PIPE, stdout=out, stderr=PIPE)
stdout, stderr = proc.communicate(doc)