diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
commit | 943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch) | |
tree | 421cfedbc60603d02e0b314d9204e9f85dd781c5 /py/demo/Ice/throughput/Server.py | |
parent | minor fix to IcePHP getLogger (diff) | |
download | ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2 ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip |
python 3 support
Diffstat (limited to 'py/demo/Ice/throughput/Server.py')
-rwxr-xr-x | py/demo/Ice/throughput/Server.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/py/demo/Ice/throughput/Server.py b/py/demo/Ice/throughput/Server.py index 3d1eb775d7c..ff51e35cc26 100755 --- a/py/demo/Ice/throughput/Server.py +++ b/py/demo/Ice/throughput/Server.py @@ -17,10 +17,13 @@ class ThroughputI(Demo.Throughput): def __init__(self): warmup = False - bytes = [] - bytes[0:Demo.ByteSeqSize] = range(0, Demo.ByteSeqSize) - bytes = ['\x00' for x in bytes] - self.byteSeq = ''.join(bytes) + if sys.version_info[0] == 2: + b = [] + b[0:Demo.ByteSeqSize] = range(0, Demo.ByteSeqSize) + b = ['\x00' for x in b] + self.byteSeq = ''.join(b) + else: + self.byteSeq = bytes([0 for x in range(0, Demo.ByteSeqSize)]) self.stringSeq = [] self.stringSeq[0:Demo.StringSeqSize] = range(0, Demo.StringSeqSize) @@ -105,7 +108,7 @@ class ThroughputI(Demo.Throughput): class Server(Ice.Application): def run(self, args): if len(args) > 1: - print self.appName() + ": too many arguments" + print(self.appName() + ": too many arguments") return 1 adapter = self.communicator().createObjectAdapter("Throughput") |