Refs #29350 -- Fixed 'invalid escape sequence' warning in SQLite introspection.

This commit is contained in:
Tim Graham 2018-05-08 10:42:24 -04:00 committed by GitHub
parent c4158d050f
commit 7ac3008fe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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