Merge "Fix DeprecationWarning: invalid escape sequence"
This commit is contained in:
commit
33eeff6c8d
@ -32,10 +32,10 @@ Guidelines for writing new hacking checks
|
||||
|
||||
asse_trueinst_re = re.compile(
|
||||
r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
|
||||
"(\w|\.|\'|\"|\[|\])+\)\)")
|
||||
r"(\w|\.|\'|\"|\[|\])+\)\)")
|
||||
asse_equal_type_re = re.compile(
|
||||
r"(.)*assertEqual\(type\((\w|\.|\'|\"|\[|\])+\), "
|
||||
"(\w|\.|\'|\"|\[|\])+\)")
|
||||
r"(\w|\.|\'|\"|\[|\])+\)")
|
||||
asse_equal_end_with_none_re = re.compile(
|
||||
r"(.)*assertEqual\((\w|\.|\'|\"|\[|\])+, None\)")
|
||||
asse_equal_start_with_none_re = re.compile(
|
||||
|
@ -31,7 +31,7 @@ TEST_VAR_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
|
||||
def set_config_value(filepath, key, value):
|
||||
"""Set 'key = value' in config file"""
|
||||
replacement_line = '%s = %s\n' % (key, value)
|
||||
match = re.compile('^%s\s+=' % key).match
|
||||
match = re.compile(r'^%s\s+=' % key).match
|
||||
with open(filepath, 'r+') as f:
|
||||
lines = f.readlines()
|
||||
f.seek(0, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user