Skip to content

Commit

Permalink
fixed broken tests
Browse files Browse the repository at this point in the history
Signed-off-by: ahmedsobeh <[email protected]>
  • Loading branch information
ahmedsobeh committed Jul 3, 2024
1 parent 605aea2 commit 2d6b934
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions valkey/_parsers/url_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def parse_url(url: str, async_connection: bool):
supported_schemes = ["valkey", "valkeys", "redis", "rediss", "unix"]
parsed: ParseResult = urlparse(url)
kwargs: ConnectKwargs = {}
pattern = re.compile(r"^{}://".format(re.escape(url)))
if pattern.match(url):
pattern = re.compile(r'^(?:' + '|'.join(map(re.escape, supported_schemes)) + r')://')
if not pattern.match(url):
raise ValueError(
f"Valkey URL must specify one of the following schemes {supported_schemes}"
)
Expand Down

0 comments on commit 2d6b934

Please sign in to comment.