From 624c4938785fffa1e31ffdb9c51aa67b7bd0a546 Mon Sep 17 00:00:00 2001 From: Janos Gabler Date: Sat, 20 Jan 2024 13:07:56 +0100 Subject: [PATCH] Fix. --- src/tranquilo/options.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tranquilo/options.py b/src/tranquilo/options.py index dbe0312..44c2982 100644 --- a/src/tranquilo/options.py +++ b/src/tranquilo/options.py @@ -235,8 +235,9 @@ def update_option_bundle(default_options, user_options=None): # convert types if possible typed = {} for k, v in user_options.items(): - target_type = type(getattr(default_options, k)) - if isinstance(v, target_type): + default_option = getattr(default_options, k) + target_type = type(default_option) + if isinstance(v, target_type) or default_option is None: typed[k] = v else: typed[k] = target_type(v)