Skip to content

Commit

Permalink
don't deepcopy ModuleImportRaiser
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Nov 15, 2023
1 parent 3e70369 commit 04f9311
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gustaf/helpers/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ def make_valid_options(*options):
for opt in options:
if isinstance(opt, Option):
# copy option object to avoid overwriting defaults
valid_options[opt.key] = deepcopy(opt)
# only exception is if this option is a backend object
# and wrapped by ModuleImportRaiser
if "ModuleImportRaiser" in str(type(opt)):
valid_options[opt.key] = opt
else:
valid_options[opt.key] = deepcopy(opt)
elif isinstance(opt, SetDefault):
# overwrite default of existing option.
if opt.key not in valid_options:
Expand Down

0 comments on commit 04f9311

Please sign in to comment.