diff --git a/traitlets/traitlets.py b/traitlets/traitlets.py index 73133842..6f03c257 100644 --- a/traitlets/traitlets.py +++ b/traitlets/traitlets.py @@ -1006,7 +1006,13 @@ def setup_class(cls, classdict): # noqa mro = cls.mro() for name in dir(cls): - value = getattr(cls, name) + # Some descriptors raise AttributeError like zope.interface's + # __provides__ attributes even though they exist. This causes + # AttributeErrors even though they are listed in dir(cls). + try: + value = getattr(cls, name) + except AttributeError: + continue if isinstance(value, TraitType): cls._traits[name] = value trait = value