Altered pOpen patch to use sys.executable instead of os.environ['_']
This commit is contained in:
parent
c00ddec9a9
commit
9dbc6b5dbe
@ -1,5 +1,5 @@
|
|||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
import os
|
import sys
|
||||||
|
|
||||||
def run(script, doc, output_file=None, options={}):
|
def run(script, doc, output_file=None, options={}):
|
||||||
""" process an Python script """
|
""" 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()], [])
|
options = sum([['--'+key, value] for key,value in options.items()], [])
|
||||||
|
|
||||||
python = os.environ.get('_', 'python')
|
proc = Popen([sys.executable, script] + options,
|
||||||
proc = Popen([python, script] + options,
|
|
||||||
stdin=PIPE, stdout=out, stderr=PIPE)
|
stdin=PIPE, stdout=out, stderr=PIPE)
|
||||||
|
|
||||||
stdout, stderr = proc.communicate(doc)
|
stdout, stderr = proc.communicate(doc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user