Skip to content

Commit fa6af54

Browse files
add kwargs to _warnings.py
1 parent 1a0610e commit fa6af54

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fmriprep/_warnings.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@
2929
_wlog.addHandler(logging.NullHandler())
3030

3131

32-
def _warn(message, category=None, stacklevel=1, source=None):
32+
def _warn(message, category=None, stacklevel=1, source=None, **kwargs):
3333
"""Redefine the warning function."""
3434
if category is not None:
3535
category = type(category).__name__
3636
category = category.replace('type', 'WARNING')
3737

38+
if kwargs:
39+
logging.getLogger('py.warnings').warning(f'Extra warning kwargs: {kwargs}')
40+
3841
logging.getLogger('py.warnings').warning(f'{category or "WARNING"}: {message}')
3942

4043

41-
def _showwarning(message, category, filename, lineno, file=None, line=None):
42-
_warn(message, category=category)
44+
def _showwarning(message, category, filename, lineno, file=None, line=None, , **kwargs):
45+
_warn(message, category=category, **kwargs)
4346

4447

4548
warnings.warn = _warn

0 commit comments

Comments
 (0)