From 8e2ec8742ec2bbc8a919e138a107d0ee798415f5 Mon Sep 17 00:00:00 2001 From: Andreas Hasenkopf Date: Mon, 11 Dec 2023 11:44:52 +0100 Subject: [PATCH] Support for new OSC config --- osctiny/utils/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osctiny/utils/conf.py b/osctiny/utils/conf.py index 829f068..6ed8053 100644 --- a/osctiny/utils/conf.py +++ b/osctiny/utils/conf.py @@ -199,7 +199,12 @@ def get_cookie_jar() -> typing.Optional[LWPCookieJar]: .. versionadded:: 0.8.0 """ if _conf is not None: - path = _conf._identify_osccookiejar() # pylint: disable=protected-access + try: + # New OSC config + path = _conf.config.cookiejar + except AttributeError: + # Backward compatibility to old OSC config style + path = _conf._identify_osccookiejar() # pylint: disable=protected-access if os.path.isfile(path): return LWPCookieJar(filename=path)