Commit a216d544 authored by hjk's avatar hjk
Browse files

Debugger: Fix operation with python 2.6



Change-Id: Iecfea8f6e1531228fd6cccc424ee4c6c2036098e
Reviewed-by: default avatarAndy Shaw <andy.shaw@digia.com>
parent dc43f70e
...@@ -123,9 +123,12 @@ class Blob(object): ...@@ -123,9 +123,12 @@ class Blob(object):
def toBytes(self): def toBytes(self):
"""Retrieves "lazy" contents from memoryviews.""" """Retrieves "lazy" contents from memoryviews."""
data = self.data data = self.data
if isinstance(data, memoryview):
data = data.tobytes() major = sys.version_info[0]
if sys.version_info[0] == 2 and isinstance(data, buffer): if major == 3 or (major == 2 and sys.version_info[1] >= 7):
if isinstance(data, memoryview):
data = data.tobytes()
if major == 2 and isinstance(data, buffer):
data = ''.join([c for c in data]) data = ''.join([c for c in data])
return data return data
......
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