Improved support for Python 3.

This commit is contained in:
Niko Wenselowski
2014-01-09 18:03:53 +01:00
parent d34fac6814
commit b9aa0530a8
4 changed files with 13 additions and 5 deletions

View File

@ -188,7 +188,7 @@ class BaseCursor(object):
try:
r = None
r = self._query(query)
except TypeError, m:
except TypeError as m:
if m.args[0] in ("not enough arguments for format string",
"not all arguments converted"):
self.messages.append((ProgrammingError, m.args[0]))
@ -247,7 +247,7 @@ class BaseCursor(object):
for key, item in a.iteritems()))
else:
q.append(qv % tuple([db.literal(item) for item in a]))
except TypeError, msg:
except TypeError as msg:
if msg.args[0] in ("not enough arguments for format string",
"not all arguments converted"):
self.errorhandler(self, ProgrammingError, msg.args[0])