diff --git a/bumble/transport/__init__.py b/bumble/transport/__init__.py index 5b9e0168..6a9a6b53 100644 --- a/bumble/transport/__init__.py +++ b/bumble/transport/__init__.py @@ -82,14 +82,13 @@ async def open_transport(name: str) -> Transport: scheme, *tail = name.split(':', 1) spec = tail[0] if tail else None + metadata = None if spec: # Metadata may precede the spec if spec.startswith('['): metadata_str, *tail = spec[1:].split(']') spec = tail[0] if tail else None metadata = dict([entry.split('=') for entry in metadata_str.split(',')]) - else: - metadata = None transport = await _open_transport(scheme, spec) if metadata: