From 1992cf572ac63f22338961fd78471453c8c7a00b Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Fri, 25 Apr 2025 01:24:01 -0700 Subject: [PATCH] [traits.annotatable] Don't break when setting annotations to None --- masque/traits/annotatable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/traits/annotatable.py b/masque/traits/annotatable.py index 1b2ba23..1ae41e1 100644 --- a/masque/traits/annotatable.py +++ b/masque/traits/annotatable.py @@ -45,6 +45,6 @@ class AnnotatableImpl(Annotatable, metaclass=ABCMeta): @annotations.setter def annotations(self, annotations: annotations_t) -> None: - if not isinstance(annotations, dict): - raise MasqueError(f'annotations expected dict, got {type(annotations)}') + if not isinstance(annotations, dict) and annotations is not None: + raise MasqueError(f'annotations expected dict or None, got {type(annotations)}') self._annotations = annotations