fix PEP8 W605 invalid escape sequence

Python 3.7 will get a lot stricter with escape sequences.  They must be
valid.

* https://lintlyci.github.io/Flake8Rules/rules/W605.html
* https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
This commit is contained in:
Hans-Christoph Steiner 2018-05-29 13:51:47 +02:00
parent e6d5260c3c
commit ff90c0246e
11 changed files with 24 additions and 24 deletions

View file

@ -39,7 +39,7 @@ def disable_in_config(key, value):
'''write a key/value to the local config.py, then comment it out'''
with open('config.py', 'r', encoding='utf8') as f:
data = f.read()
pattern = '\n[\s#]*' + key + '\s*=\s*"[^"]*"'
pattern = r'\n[\s#]*' + key + r'\s*=\s*"[^"]*"'
repl = '\n#' + key + ' = "' + value + '"'
data = re.sub(pattern, repl, data)
with open('config.py', 'w', encoding='utf8') as f:
@ -106,7 +106,7 @@ def main():
except KeyboardInterrupt:
print('')
sys.exit(1)
if re.match('^\s*$', s) is not None:
if re.match(r'^\s*$', s) is not None:
test_config['sdk_path'] = default_sdk_path
else:
test_config['sdk_path'] = s