summaryrefslogtreecommitdiff
path: root/py/demo/IceGrid/simple/expect.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
committerMark Spruiell <mes@zeroc.com>2012-04-24 14:16:15 -0700
commit943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch)
tree421cfedbc60603d02e0b314d9204e9f85dd781c5 /py/demo/IceGrid/simple/expect.py
parentminor fix to IcePHP getLogger (diff)
downloadice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz
ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip
python 3 support
Diffstat (limited to 'py/demo/IceGrid/simple/expect.py')
-rwxr-xr-xpy/demo/IceGrid/simple/expect.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/py/demo/IceGrid/simple/expect.py b/py/demo/IceGrid/simple/expect.py
index f12d7722b5f..57c2b114b98 100755
--- a/py/demo/IceGrid/simple/expect.py
+++ b/py/demo/IceGrid/simple/expect.py
@@ -16,16 +16,19 @@ if len(head) > 0:
path = [os.path.join(head, p) for p in path]
path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ]
if len(path) == 0:
- raise "can't find toplevel directory!"
+ raise RuntimeError("can't find toplevel directory!")
sys.path.append(path[0])
-from demoscript import *
+from demoscript import Util
from demoscript.IceGrid import simple
def rewrite(namein, nameout):
fi = open(namein, "r")
fo = open(nameout, "w")
for l in fi:
+ if sys.version_info[0] == 3:
+ if l.find('exe="python"') != -1:
+ l = l.replace('exe="python"', 'exe="python3"')
if l.find('option') != -1:
fo.write('<option>-u</option>')
fo.write(l)