Commit 6aacdb4f authored by Denis Bilenko's avatar Denis Bilenko

fix #94: python2.7 array.array doesn't support memoryview used in gevent.socket.send

parent cc7063bb
......@@ -255,8 +255,13 @@ if sys.version_info[:2] <= (2, 4):
if sys.version_info[:2] < (2, 7):
_get_memory = buffer
elif sys.version_info[:2] < (3, 0):
def _get_memory(string, offset):
try:
return memoryview(string)[offset:]
except TypeError:
return buffer(string, offset)
else:
def _get_memory(string, offset):
return memoryview(string)[offset:]
......
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