Skip to content

Commit 41310c2

Browse files
committed
fix(re): use raw strings r"" for regexps
1 parent 46740de commit 41310c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/utils/storage/S3Storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, url, **kwargs):
3131
url = "https" + url[8:]
3232

3333
s3_dest = re.match(
34-
"^(?P<endpoint>https?://[^/]*)(/(?P<bucket>[^/]+))?(/(?P<path>.*))?$",
34+
r"^(?P<endpoint>https?://[^/]*)(/(?P<bucket>[^/]+))?(/(?P<path>.*))?$",
3535
url,
3636
).groupdict()
3737

api/utils/storage/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66

77
def Storage(url, **kwargs):
8-
if re.search("^(https?\+)?s3://", url):
8+
if re.search(r"^(https?\+)?s3://", url):
99
return S3Storage(url, **kwargs)
1010

11-
if re.search("^https?://", url):
11+
if re.search(r"^https?://", url):
1212
return HTTPStorage(url, **kwargs)
1313

1414
raise RuntimeError("No storage handler for: " + url)

0 commit comments

Comments
 (0)