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/test/Ice/operations/BatchOneways.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/test/Ice/operations/BatchOneways.py')
-rw-r--r-- | py/test/Ice/operations/BatchOneways.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/py/test/Ice/operations/BatchOneways.py b/py/test/Ice/operations/BatchOneways.py index a263d190d07..97d8eec9c04 100644 --- a/py/test/Ice/operations/BatchOneways.py +++ b/py/test/Ice/operations/BatchOneways.py @@ -7,7 +7,7 @@ # # ********************************************************************** -import Ice, Test, array +import Ice, Test, array, sys def test(b): if not b: @@ -15,20 +15,25 @@ def test(b): def batchOneways(p): - bs1 = [] - bs1[0:10 * 1024] = range(0, 10 * 1024) # add 100,000 entries. - bs1 = ['\x00' for x in bs1] # set them all to \x00 - bs1 = ''.join(bs1) # make into a byte array - - bs2 = [] - bs2[0:99 * 1024] = range(0, 99 * 1024) # add 100,000 entries. - bs2 = ['\x00' for x in bs2] # set them all to \x00 - bs2 = ''.join(bs2) # make into a byte array - - bs3 = [] - bs3[0:100 * 1024] = range(0, 100 * 1024) # add 100,000 entries. - bs3 = ['\x00' for x in bs3] # set them all to \x00 - bs3 = ''.join(bs3) # make into a byte array + if sys.version_info[0] == 2: + bs1 = [] + bs1[0:10 * 1024] = range(0, 10 * 1024) # add 100,000 entries. + bs1 = ['\x00' for x in bs1] # set them all to \x00 + bs1 = ''.join(bs1) # make into a byte array + + bs2 = [] + bs2[0:99 * 1024] = range(0, 99 * 1024) # add 100,000 entries. + bs2 = ['\x00' for x in bs2] # set them all to \x00 + bs2 = ''.join(bs2) # make into a byte array + + bs3 = [] + bs3[0:100 * 1024] = range(0, 100 * 1024) # add 100,000 entries. + bs3 = ['\x00' for x in bs3] # set them all to \x00 + bs3 = ''.join(bs3) # make into a byte array + else: + bs1 = bytes([0 for x in range(0, 10 * 1024)]) + bs2 = bytes([0 for x in range(0, 99 * 1024)]) + bs3 = bytes([0 for x in range(0, 100 * 1024)]) try: p.opByteSOneway(bs1) |