Skip to content

Commit 58ce219

Browse files
committed
fix connection return bytearray when query too more data
1 parent a76cf6e commit 58ce219

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tormysql/connections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def _read_bytes(self, num_bytes):
179179
self._sock._read_buffer_size = 0
180180

181181
if data_len == num_bytes:
182-
return data
182+
return bytes(data)
183183

184184
self._rbuffer_size = data_len - num_bytes
185185
self._rbuffer = StringIO(data)
@@ -193,7 +193,7 @@ def read_callback(future):
193193
try:
194194
data = future.result()
195195
if len(data) == num_bytes:
196-
return child_gr.switch(data)
196+
return child_gr.switch(bytes(data))
197197

198198
self._rbuffer_size = len(data) - num_bytes
199199
self._rbuffer = StringIO(data)

0 commit comments

Comments
 (0)