From 7ac3008fe473f8015bda9789be23657d3b329e6d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 8 May 2018 10:42:24 -0400 Subject: [PATCH] Refs #29350 -- Fixed 'invalid escape sequence' warning in SQLite introspection. --- django/db/backends/sqlite3/introspection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py index 72e3d94955..75fb9a7ced 100644 --- a/django/db/backends/sqlite3/introspection.py +++ b/django/db/backends/sqlite3/introspection.py @@ -192,7 +192,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): fields_sql = create_sql[create_sql.index('(') + 1:create_sql.rindex(')')] for field_desc in fields_sql.split(','): field_desc = field_desc.strip() - m = re.match('(?:(?:["`\[])(.*)(?:["`\]])|(\w+)).*PRIMARY KEY.*', field_desc) + m = re.match(r'(?:(?:["`\[])(.*)(?:["`\]])|(\w+)).*PRIMARY KEY.*', field_desc) if m: return m.group(1) if m.group(1) else m.group(2) return None