Skip to content

Commit

Permalink
suppress warning
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Apr 18, 2022
1 parent a8feed1 commit 2bdea3e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions napari_skimage_regionprops/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,17 @@ def get_table(labels_layer: napari.layers.Layer, viewer:napari.Viewer) -> TableW
Searches inside a viewer for a given table and returns it. If it cannot find it,
it will return None.
"""
for widget in list(viewer.window._dock_widgets.values()):
potential_table_widget = widget.widget()
if isinstance(potential_table_widget, TableWidget):
if potential_table_widget._layer is labels_layer:
return potential_table_widget
import warnings
# see: https://github.com/napari/napari/issues/3944
with warnings.catch_warnings():
warnings.simplefilter("ignore")

for widget in list(viewer.window._dock_widgets.values()):
potential_table_widget = widget.widget()
if isinstance(potential_table_widget, TableWidget):
if potential_table_widget._layer is labels_layer:
return potential_table_widget

return None

def _determine_frame_column(table):
Expand Down

0 comments on commit 2bdea3e

Please sign in to comment.