From a503041070b79af991d7cc83cf10928dc03929e7 Mon Sep 17 00:00:00 2001 From: "stephen.worsley" Date: Sun, 11 Feb 2024 22:56:14 +0000 Subject: [PATCH] fix warnings --- lib/iris/exceptions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/iris/exceptions.py b/lib/iris/exceptions.py index ad7e6b06cc..3686f0f814 100644 --- a/lib/iris/exceptions.py +++ b/lib/iris/exceptions.py @@ -350,16 +350,16 @@ class IrisSaverFillValueWarning(IrisMaskValueMatchWarning, IrisSaveWarning): @lru_cache(None) -def warn_once(msg, type, stacklevel, frame, **kwargs): +def warn_once(msg, stacklevel, frame, **kwargs): """Raise a warning only if a similar one has not been raised before.""" - warnings.warn(msg, type, stacklevel=stacklevel, **kwargs) + warnings.warn(msg, stacklevel=stacklevel, **kwargs) -def warn_once_at_level(msg, type=None, stacklevel=0, **kwargs): +def warn_once_at_level(msg, stacklevel=0, **kwargs): """ Raise a warning only if a similar one hasn't been raised from the same line for a given stack level. """ stacklevel += 1 frame = traceback.format_stack()[-stacklevel] - warn_once(msg, type, stacklevel + 1, frame, **kwargs) + warn_once(msg, stacklevel + 1, frame, **kwargs)