Skip to content

Commit

Permalink
fixes raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Oct 15, 2024
1 parent 2d5fd94 commit f81a0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cs50/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ def execute(self, sql, *args, **kwargs):
sqlparse.tokens.Literal.String,
sqlparse.tokens.Literal.String.Single,
]:
token.value = re.sub("(^'|\s+):", r"\1\:", token.value)
token.value = re.sub(r"(^'|\s+):", r"\1\:", token.value)

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

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

0 comments on commit f81a0a3

Please sign in to comment.