Lint: W605 invalid escape sequence '<char>'

The previous attempt to correct these with character classes failed.
Instead, use the proper `r'blah'` regex formatting.
This commit is contained in:
2020-11-07 17:41:09 -05:00
parent 3ed97d209f
commit 0bf130077c
6 changed files with 33 additions and 33 deletions

View File

@ -106,11 +106,11 @@ def list_template(limit, table, is_fuzzy=True):
if limit:
if is_fuzzy:
# Handle fuzzy vs. non-fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '%' + limit
else:
limit = limit[1:]
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '%'
else:
limit = limit[:-1]
@ -606,11 +606,11 @@ def list_userdata(limit, is_fuzzy=True):
if limit:
if is_fuzzy:
# Handle fuzzy vs. non-fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '%' + limit
else:
limit = limit[1:]
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '%'
else:
limit = limit[:-1]
@ -701,11 +701,11 @@ def list_script(limit, is_fuzzy=True):
if limit:
if is_fuzzy:
# Handle fuzzy vs. non-fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '%' + limit
else:
limit = limit[1:]
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '%'
else:
limit = limit[:-1]
@ -796,11 +796,11 @@ def list_profile(limit, is_fuzzy=True):
if limit:
if is_fuzzy:
# Handle fuzzy vs. non-fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '%' + limit
else:
limit = limit[1:]
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '%'
else:
limit = limit[:-1]