diff options
Diffstat (limited to 'py/test/Ice/operations/TestI.py')
-rw-r--r-- | py/test/Ice/operations/TestI.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/py/test/Ice/operations/TestI.py b/py/test/Ice/operations/TestI.py index 58505a9d0b4..c03292e1a10 100644 --- a/py/test/Ice/operations/TestI.py +++ b/py/test/Ice/operations/TestI.py @@ -7,7 +7,7 @@ # # ********************************************************************** -import Ice, Test +import Ice, Test, sys def test(b): if not b: @@ -63,11 +63,15 @@ class MyDerivedClassI(Test.MyDerivedClass): return (p2, p1) def opByteS(self, p1, p2, current=None): - # By default sequence<byte> maps to a string. - p3 = map(ord, p1) - p3.reverse() - r = map(ord, p1) - r.extend(map(ord, p2)) + if sys.version_info[0] == 2: + # By default sequence<byte> maps to a string. + p3 = map(ord, p1) + p3.reverse() + r = map(ord, p1) + r.extend(map(ord, p2)) + else: + p3 = bytes(reversed(p1)) + r = p1 + p2 return (r, p3) def opBoolS(self, p1, p2, current=None): |