Fix some 'DeprecationWarning: invalid escape sequence' warnings and use str.format for string interpolation.
I am seeing a lot of deperecation warnings when I use moto for my tests (running under pytest), so I figured I'll clean up some of them.
This commit is contained in:
parent
c54e2ec001
commit
374b623e1d
6 changed files with 20 additions and 18 deletions
|
|
@ -52,7 +52,7 @@ def parse_region_from_url(url):
|
|||
|
||||
def metadata_from_headers(headers):
|
||||
metadata = {}
|
||||
meta_regex = re.compile("^x-amz-meta-([a-zA-Z0-9\-_]+)$", flags=re.IGNORECASE)
|
||||
meta_regex = re.compile(r"^x-amz-meta-([a-zA-Z0-9\-_]+)$", flags=re.IGNORECASE)
|
||||
for header, value in headers.items():
|
||||
if isinstance(header, six.string_types):
|
||||
result = meta_regex.match(header)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue