Skip to content

Commit

Permalink
removed needless if block
Browse files Browse the repository at this point in the history
Signed-off-by: ahmedsobeh <[email protected]>
  • Loading branch information
ahmedsobeh committed Jul 2, 2024
1 parent 02f76a0 commit 62a1ff4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions valkey/_parsers/url_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ def to_bool(value) -> Optional[bool]:


def parse_url(url: str, async_connection: bool):
url_prefixes = ["valkey://", "valkeys://", "unix://", "redis://", "rediss://"]
supported_schemes = ["valkey", "valkeys", "redis", "rediss"]

if not any(url.startswith(prefix) for prefix in url_prefixes):
raise ValueError(
f"Valkey URL must specify one of the following schemes {url_prefixes}"
)

parsed: ParseResult = urlparse(url)
kwargs: ConnectKwargs = {}

Expand Down Expand Up @@ -94,7 +88,7 @@ def parse_url(url: str, async_connection: bool):
)
else:
raise ValueError(
f"Valkey URL must specify one of the following schemes ({url_prefixes})"
f"Valkey URL must specify one of the following schemes ({supported_schemes})"
)

return kwargs

0 comments on commit 62a1ff4

Please sign in to comment.