Skip to content

Commit c326759

Browse files
authored
Merge pull request #3650 from jasongrout/deprecationwarnings
Fix unintentional deprecation warnings
2 parents 10dca83 + 56a39f7 commit c326759

File tree

1 file changed

+4
-4
lines changed
  • python/ipywidgets/ipywidgets/widgets

1 file changed

+4
-4
lines changed

python/ipywidgets/ipywidgets/widgets/widget.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def widgets():
310310
# did not explicitly try to use this attribute, we do not want to throw a deprecation warning.
311311
# So we check if the thing calling this static property is one of the known initialization functions in traitlets.
312312
frame = _get_frame(2)
313-
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))):
313+
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))):
314314
deprecation("Widget.widgets is deprecated.")
315315
return _instances
316316

@@ -320,7 +320,7 @@ def _active_widgets():
320320
# did not explicitly try to use this attribute, we do not want to throw a deprecation warning.
321321
# So we check if the thing calling this static property is one of the known initialization functions in traitlets.
322322
frame = _get_frame(2)
323-
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))):
323+
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))):
324324
deprecation("Widget._active_widgets is deprecated.")
325325
return _instances
326326

@@ -330,7 +330,7 @@ def _widget_types():
330330
# did not explicitly try to use this attribute, we do not want to throw a deprecation warning.
331331
# So we check if the thing calling this static property is one of the known initialization functions in traitlets.
332332
frame = _get_frame(2)
333-
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))):
333+
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))):
334334
deprecation("Widget._widget_types is deprecated.")
335335
return _registry
336336

@@ -340,7 +340,7 @@ def widget_types():
340340
# did not explicitly try to use this attribute, we do not want to throw a deprecation warning.
341341
# So we check if the thing calling this static property is one of the known initialization functions in traitlets.
342342
frame = _get_frame(2)
343-
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance'))):
343+
if not (frame.f_code.co_filename == TRAITLETS_FILE and (frame.f_code.co_name in ('getmembers', 'setup_instance', 'setup_class'))):
344344
deprecation("Widget.widget_types is deprecated.")
345345
return _registry
346346

0 commit comments

Comments
 (0)