From 2a591b8d6eff9d3a3821e9bac5e289c4fb7018d2 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Thu, 1 Feb 2024 23:14:43 +0100 Subject: Fix key error in set_cookies --- g4f/Provider/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g4f') diff --git a/g4f/Provider/helper.py b/g4f/Provider/helper.py index 9788bffd..2cab5e6f 100644 --- a/g4f/Provider/helper.py +++ b/g4f/Provider/helper.py @@ -51,7 +51,7 @@ def get_cookies(domain_name: str = '', raise_requirements_error: bool = True) -> def set_cookies(domain_name: str, cookies: Cookies = None) -> None: if cookies: _cookies[domain_name] = cookies - else: + elif domain_name in _cookies: _cookies.pop(domain_name) def load_cookies_from_browsers(domain_name: str, raise_requirements_error: bool = True) -> Cookies: -- cgit v1.2.3