From f5d3e7ce5381729ac30901370af8ef5a34fadf96 Mon Sep 17 00:00:00 2001 From: Lu Weizheng Date: Tue, 13 Aug 2024 17:52:35 +0800 Subject: [PATCH] filter config --- python/xoscar/backends/communication/socket.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/xoscar/backends/communication/socket.py b/python/xoscar/backends/communication/socket.py index c20e04c..816859f 100644 --- a/python/xoscar/backends/communication/socket.py +++ b/python/xoscar/backends/communication/socket.py @@ -203,9 +203,11 @@ def channel_type(self) -> int: @classmethod def parse_config(cls, config: dict) -> dict: + if config is None or not config: + return dict() # we only need the following config - keys_of_interest = ["listen_elastic_ip", "address", "host", "port"] - parsed_config = {key: config[key] for key in keys_of_interest if key in config} + keys = ["listen_elastic_ip"] + parsed_config = {key: config[key] for key in keys if key in config} return parsed_config