Fix some 'DeprecationWarning: invalid escape sequence' warnings and use str.format for string interpolation.

Similar to https://github.com/spulec/moto/pull/2811
This commit is contained in:
Asher Foa 2020-03-25 11:07:59 -07:00
commit 2e20ad14df
4 changed files with 18 additions and 13 deletions

View file

@ -134,7 +134,7 @@ def parse_requestline(s):
ValueError: Not a Request-Line
"""
methods = "|".join(HttpBaseClass.METHODS)
m = re.match(r"(" + methods + ")\s+(.*)\s+HTTP/(1.[0|1])", s, re.I)
m = re.match(r"({})\s+(.*)\s+HTTP/(1.[0|1])".format(methods), s, re.I)
if m:
return m.group(1).upper(), m.group(2), m.group(3)
else: