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:
parent
ef704852dd
commit
2e20ad14df
4 changed files with 18 additions and 13 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue