mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-29 13:30:24 +08:00
Work around limitation in warnings.warn
This commit is contained in:
1 parent
e24953cf74
commit
4f54b9ed5a
1 file changed
+3
-2
@@ -7,10 +7,11 @@ import re
|
||||
__all__ = ['all_warnings', 'expected_warnings', 'warn']
|
||||
|
||||
|
||||
def warn(message, category=None, stacklevel=2):
|
||||
def warn(message, **kwargs):
|
||||
"""A version of `warnings.warn` with a default stacklevel of 2.
|
||||
"""
|
||||
warnings.warn(message, category=category, stacklevel=stacklevel)
|
||||
kwargs.setdefault('stacklevel', 2)
|
||||
warnings.warn(message, **kwargs)
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
||||
Reference in new issue
Block a user