shell/py.py now tries to pOpen using the python that is currently running, as opposed to just using 'python'.

This commit is contained in:
Joe Gregorio 2006-09-29 09:59:07 -04:00
parent f97a4adccd
commit c00ddec9a9

View File

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