test/contrib: Fix invalid escapes in regex strings

Flagged by flake8 v3.6.0, as W605, plus a few others identified
incidentally, e.g. 59ffecf66cf4d08c4b431e457b083878d66a3fd6.

Note that r"\n" matches to "\n" under re.match/search.
This commit is contained in:
Ben Woosley 2019-02-01 17:00:02 -08:00
parent 6e431296da
commit b21680baf5
No known key found for this signature in database
GPG key ID: 6EE5F3785F78B345
14 changed files with 38 additions and 41 deletions

View file

@ -55,7 +55,7 @@ def normalize(s):
assert type(s) is str
s = s.replace("\n", " ")
s = s.replace("\t", " ")
s = re.sub("/\*.*?\*/", " ", s)
s = re.sub(r"/\*.*?\*/", " ", s)
s = re.sub(" {2,}", " ", s)
return s.strip()