Commit 4558f2c5 authored by Denis Bilenko's avatar Denis Bilenko

test_ssl.py: fix NameError on 2.4

parent 47c4512e
...@@ -1085,6 +1085,10 @@ else: ...@@ -1085,6 +1085,10 @@ else:
except Exception, x: except Exception, x:
raise support.TestFailed("Unexpected exception: " + str(x)) raise support.TestFailed("Unexpected exception: " + str(x))
else: else:
try:
bytearray
except NameError:
bytearray = None
# helper methods for standardising recv* method signatures # helper methods for standardising recv* method signatures
def _recv_into(): def _recv_into():
b = bytearray("\0"*100) b = bytearray("\0"*100)
...@@ -1108,6 +1112,8 @@ else: ...@@ -1108,6 +1112,8 @@ else:
('recv_into', _recv_into, True, []), ('recv_into', _recv_into, True, []),
('recvfrom_into', _recvfrom_into, False, []), ('recvfrom_into', _recvfrom_into, False, []),
] ]
if bytearray is None:
recv_methods = recv_methods[:-2]
data_prefix = u"PREFIX_" data_prefix = u"PREFIX_"
for meth_name, send_meth, expect_success, args in send_methods: for meth_name, send_meth, expect_success, args in send_methods:
......
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