From b7216a2dff12b344955e3d0797a8bae9eefd08a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Sun, 17 Jul 2016 19:11:02 +0200 Subject: [PATCH] Use our internal warning context manager --- skimage/data/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/skimage/data/__init__.py b/skimage/data/__init__.py index c30b80e1..577e129c 100644 --- a/skimage/data/__init__.py +++ b/skimage/data/__init__.py @@ -7,11 +7,11 @@ For more images, see """ import os as _os -import warnings from .. import data_dir from ..io import imread, use_plugin from .._shared.utils import deprecated +from .._shared._warnings import expected_warnings from ._binary_blobs import binary_blobs from .. import img_as_bool @@ -161,8 +161,7 @@ def horse(): (marauder). """ - with warnings.catch_warnings(): - warnings.simplefilter("ignore") + with expected_warnings(['precision loss']): return img_as_bool(load("horse.png", as_grey=True))