We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36bdd89 commit b56ad85Copy full SHA for b56ad85
1 file changed
cassandra/encoder.py
@@ -13,8 +13,14 @@
13
14
15
def cql_quote(term):
16
+ # The ordering of this method is important for the result of this method to
17
+ # be a native str type (for both Python 2 and 3)
18
+
19
+ # Handle quoting of native str and bool types
20
if isinstance(term, (str, bool)):
21
return "'%s'" % str(term).replace("'", "''")
22
+ # This branch of the if statement will only be used by Python 2 to catch
23
+ # unicode strings, text_type is used to prevent type errors with Python 3.
24
elif isinstance(term, six.text_type):
25
return "'%s'" % term.encode('utf8').replace("'", "''")
26
else:
0 commit comments