diff --git a/python/ipywidgets/ipywidgets/widgets/widget.py b/python/ipywidgets/ipywidgets/widgets/widget.py index f7bbdc1dd9..4f4dcb3732 100644 --- a/python/ipywidgets/ipywidgets/widgets/widget.py +++ b/python/ipywidgets/ipywidgets/widgets/widget.py @@ -310,7 +310,7 @@ def widgets(): # did not explicitly try to use this attribute, we do not want to throw a deprecation warning. # So we check if the thing calling this static property is one of the known initialization functions in traitlets. frame = _get_frame(2) - if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))): + if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))): deprecation("Widget.widgets is deprecated.") return _instances @@ -320,7 +320,7 @@ def _active_widgets(): # did not explicitly try to use this attribute, we do not want to throw a deprecation warning. # So we check if the thing calling this static property is one of the known initialization functions in traitlets. frame = _get_frame(2) - if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))): + if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))): deprecation("Widget._active_widgets is deprecated.") return _instances @@ -330,7 +330,7 @@ def _widget_types(): # did not explicitly try to use this attribute, we do not want to throw a deprecation warning. # So we check if the thing calling this static property is one of the known initialization functions in traitlets. frame = _get_frame(2) - if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))): + if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))): deprecation("Widget._widget_types is deprecated.") return _registry @@ -340,7 +340,7 @@ def widget_types(): # did not explicitly try to use this attribute, we do not want to throw a deprecation warning. # So we check if the thing calling this static property is one of the known initialization functions in traitlets. frame = _get_frame(2) - if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))): + if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))): deprecation("Widget.widget_types is deprecated.") return _registry