From 9dbc6b5dbe5dca35969e4c0246df4f34d0aaf6e1 Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Sat, 30 Sep 2006 10:14:07 -0400 Subject: [PATCH] Altered pOpen patch to use sys.executable instead of os.environ['_'] --- planet/shell/py.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/planet/shell/py.py b/planet/shell/py.py index 77cad57..8f365f6 100644 --- a/planet/shell/py.py +++ b/planet/shell/py.py @@ -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)