Commit df4fccfb authored by 's avatar

Fix for running the sh function under Python 2 (dont set PYTHONHOME)

parent f7d34006
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
import sys, os import sys, os
from do import * from do import *
# Using PYTHONHOME is bad under Python 2.0
if sys.version[:1]=='2':
varname='INST_HOME'
else:
varname='PYTHONHOME'
def sh(home, user, group): def sh(home, user, group):
start=os.path.join(home, 'start') start=os.path.join(home, 'start')
if not os.path.exists(start): if not os.path.exists(start):
...@@ -94,10 +100,10 @@ def sh(home, user, group): ...@@ -94,10 +100,10 @@ def sh(home, user, group):
open(start,'w').write( open(start,'w').write(
"#! /bin/sh\n" "#! /bin/sh\n"
"reldir=`dirname $0`\n" "reldir=`dirname $0`\n"
"PYTHONHOME=`cd $reldir; pwd`\n" "%s=`cd $reldir; pwd`\n"
"export PYTHONHOME\n" "export %s\n"
'exec %s \\\n $PYTHONHOME/z2.py \\\n -D "$@"\n' 'exec %s \\\n $%s/z2.py \\\n -D "$@"\n'
% sys.executable) % (varname, varname, sys.executable, varname))
ch(start,user,group,0711) ch(start,user,group,0711)
stop=os.path.join(home, 'stop') stop=os.path.join(home, 'stop')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment