Skip to content

Commit e4632e1

Browse files
committed
Fix for py3x, again
1 parent 1274e59 commit e4632e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pymysql/cursors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def executemany(self, query, args):
147147
if m:
148148
q_prefix = m.group(1)
149149
q_values = m.group(2).rstrip()
150-
q_postfix = bytearray(m.group(3) or '')
150+
q_postfix = m.group(3) or ''
151151
assert q_values[0] == '(' and q_values[-1] == ')'
152152
return self._do_execute_many(q_prefix, q_values, q_postfix, args,
153153
self.max_stmt_length,
@@ -161,6 +161,8 @@ def _do_execute_many(self, prefix, values, postfix, args, max_stmt_length, encod
161161
escape = self._escape_args
162162
if isinstance(prefix, text_type):
163163
prefix = prefix.encode(encoding)
164+
if isinstance(postfix, text_type):
165+
postfix = postfix.encode(encoding)
164166
sql = bytearray(prefix)
165167
args = iter(args)
166168
v = values % escape(next(args), conn)

0 commit comments

Comments
 (0)