diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py index c86d0d7d..6d00d907 100644 --- a/polygon/websocket/__init__.py +++ b/polygon/websocket/__init__.py @@ -204,18 +204,16 @@ def _parse_subscription(s: str): split = s.split(".") length = len(split) - match length: - case _ if length < 2: - logger.warning("invalid subscription:", s) - return [None, None] - case 3: - return split[0], split[1] + "." + split[2] - case _ if length > 3: - logger.warning("invalid subscription:", s) - return [None, None] - case _: - return split[0], split[1] - + if length < 2: + logger.warning("invalid subscription:", s) + return [None, None] + if length == 2: + return split[0], split[1] + if length == 3: + return split[0], split[1] + "." + split[2] + if length > 3: + logger.warning("invalid subscription:", s) + return [None, None] def subscribe(self, *subscriptions: str):