Avoid crashing if cache URL has no namespace

This commit is contained in:
Danielle McLean 2024-05-14 14:07:25 +10:00
parent f74bc9b6e5
commit a471b77c55
Signed by: 00dani
GPG key ID: 6854781A0488421C

View file

@ -47,8 +47,7 @@ def make_cache(url: str, namespace: str = "") -> Cache[T]:
if parsed_url.password: if parsed_url.password:
kwargs["password"] = parsed_url.password kwargs["password"] = parsed_url.password
namespace = ":".join(s for s in [kwargs.get("namespace"), namespace] if s) namespace = ":".join(s for s in [kwargs.pop("namespace", ""), namespace] if s)
del kwargs["namespace"]
serializer = OrmsgpackSerializer if HAS_ORMSGPACK else PickleSerializer serializer = OrmsgpackSerializer if HAS_ORMSGPACK else PickleSerializer