mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
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:
parent
e6d5260c3c
commit
ff90c0246e
11 changed files with 24 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue