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

@ -574,9 +574,9 @@ def get_list_dhcp(zk_conn, network, limit, only_static=False, is_fuzzy=True):
limit = '^' + limit + '$'
# Implcitly assume fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '.*' + limit
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '.*'
except Exception as e:
return False, 'Regex Error: {}'.format(e)
@ -620,9 +620,9 @@ def get_list_acl(zk_conn, network, limit, direction, is_fuzzy=True):
limit = '^' + limit + '$'
# Implcitly assume fuzzy limits
if not re.match('\^.*', limit):
if not re.match(r'\^.*', limit):
limit = '.*' + limit
if not re.match('.*\$', limit):
if not re.match(r'.*\$', limit):
limit = limit + '.*'
except Exception as e:
return False, 'Regex Error: {}'.format(e)