From e2cd0ff48565cc554b3d701adb50f37453159353 Mon Sep 17 00:00:00 2001 From: Alexander Franzelin Date: Mon, 9 Sep 2024 09:27:34 +0200 Subject: [PATCH] fix: fix type checking --- src/mss_python/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mss_python/client.py b/src/mss_python/client.py index 1b59c1a..23cc85a 100644 --- a/src/mss_python/client.py +++ b/src/mss_python/client.py @@ -92,7 +92,7 @@ def refine_getHotelList(resp: dict) -> dict: return resp elif "hotel" not in resp["result"] or resp["result"]["hotel"] is None: return resp - elif resp["result"]["hotel"] is not list: + elif not isinstance(resp["result"]["hotel"], list): resp["result"]["hotel"] = [resp["result"]["hotel"]] for hotel in resp["result"]["hotel"]: @@ -107,5 +107,5 @@ def refine_getHotelList(resp: dict) -> dict: def ensure_list_value(hotel: dict, parent_fld: str, child_fld: str) -> None: if parent_fld not in hotel: hotel[parent_fld] = {child_fld: []} - elif hotel[parent_fld][child_fld] is not list: + elif not isinstance(hotel[parent_fld][child_fld], list): hotel[parent_fld][child_fld] = [hotel[parent_fld][child_fld]]