Fix cursor doesn't use converter in connection (#503)
This commit is contained in:
parent
7eac3b16d2
commit
c33b17d325
|
@ -5,7 +5,6 @@ import re
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from ._compat import range_type, text_type, PY2
|
from ._compat import range_type, text_type, PY2
|
||||||
|
|
||||||
from . import err
|
from . import err
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,12 +115,12 @@ class Cursor(object):
|
||||||
if isinstance(args, (tuple, list)):
|
if isinstance(args, (tuple, list)):
|
||||||
if PY2:
|
if PY2:
|
||||||
args = tuple(map(ensure_bytes, args))
|
args = tuple(map(ensure_bytes, args))
|
||||||
return tuple(conn.escape(arg) for arg in args)
|
return tuple(conn.literal(arg) for arg in args)
|
||||||
elif isinstance(args, dict):
|
elif isinstance(args, dict):
|
||||||
if PY2:
|
if PY2:
|
||||||
args = dict((ensure_bytes(key), ensure_bytes(val)) for
|
args = dict((ensure_bytes(key), ensure_bytes(val)) for
|
||||||
(key, val) in args.items())
|
(key, val) in args.items())
|
||||||
return dict((key, conn.escape(val)) for (key, val) in args.items())
|
return dict((key, conn.literal(val)) for (key, val) in args.items())
|
||||||
else:
|
else:
|
||||||
# If it's not a dictionary let's try escaping it anyways.
|
# If it's not a dictionary let's try escaping it anyways.
|
||||||
# Worst case it will throw a Value error
|
# Worst case it will throw a Value error
|
||||||
|
|
Loading…
Reference in New Issue