Skip to content

Commit 293950f

Browse files
committed
fix pypy
1 parent f6b9f6a commit 293950f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tornado_mysql/cursors.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ def _do_get_result(self):
302302
def _show_warnings(self, conn):
303303
ws = yield conn.show_warnings()
304304
for w in ws:
305-
warnings.warn(w[-1], err.Warning, 4)
305+
msg = w[-1]
306+
if PY2 and isinstance(msg, unicode):
307+
msg = msg.encode('utf-8', 'replace')
308+
warnings.warn(msg, err.Warning, 4)
306309

307310
def __iter__(self):
308311
return iter(self.fetchone, None)

0 commit comments

Comments
 (0)