]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix invalid escape sequence in docs
authorGord Thompson <gord@gordthompson.com>
Thu, 24 Feb 2022 19:07:26 +0000 (12:07 -0700)
committerGord Thompson <gord@gordthompson.com>
Thu, 24 Feb 2022 19:11:06 +0000 (12:11 -0700)
Current version of this code example will emit an
"invalid escape sequence" DeprecationWarning

Change-Id: Id753139b1661f78d6b3ba86b7ada181b693a562e

lib/sqlalchemy/sql/_elements_constructors.py

index 4132ac6798799ca93b3501d91e5d8eb5893d7611..4f6ff06889129dd73096ba85c44fd1b7b4153488 100644 (file)
@@ -1403,7 +1403,7 @@ def text(text):
     For SQL statements where a colon is required verbatim, as within
     an inline string, use a backslash to escape::
 
-        t = text("SELECT * FROM users WHERE name='\:username'")
+        t = text(r"SELECT * FROM users WHERE name='\:username'")
 
     The :class:`_expression.TextClause`
     construct includes methods which can