Skip to content

Commit b9187ba

Browse files
author
Kareem Zidane
committed
using raw string
1 parent cdc5127 commit b9187ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cs50/sql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ def execute(self, sql, *args, **kwargs):
220220
# In string literal
221221
# https://www.sqlite.org/lang_keywords.html
222222
if token.ttype in [sqlparse.tokens.Literal.String, sqlparse.tokens.Literal.String.Single]:
223-
token.value = re.sub("(^'|\s+):", "\\1\\:", token.value)
223+
token.value = re.sub("(^'|\s+):", r"\1\:", token.value)
224224

225225
# In identifier
226226
# https://www.sqlite.org/lang_keywords.html
227227
elif token.ttype == sqlparse.tokens.Literal.String.Symbol:
228-
token.value = re.sub("(^\"|\s+):", "\\1\\:", token.value)
228+
token.value = re.sub("(^\"|\s+):", r"\1\:", token.value)
229229

230230
# Join tokens into statement
231231
statement = "".join([str(token) for token in tokens])

0 commit comments

Comments
 (0)