diff --git a/loopy/diagnostic.py b/loopy/diagnostic.py index 2ea1bd40e540b24d5a08e4136ab603d6c5a422a1..c1d0e03633772bb7e3f86807f579e2b33793e6aa 100644 --- a/loopy/diagnostic.py +++ b/loopy/diagnostic.py @@ -23,6 +23,9 @@ THE SOFTWARE. """ +from pytools import MovedFunctionDeprecationWrapper + + # {{{ warnings class LoopyWarningBase(UserWarning): @@ -47,7 +50,7 @@ class WriteRaceConditionWarning(LoopyWarning): # }}} -def warn(kernel, id, text, type=LoopyWarning): +def warn_with_kernel(kernel, id, text, type=LoopyWarning): from fnmatch import fnmatchcase for sw in kernel.silenced_warnings: if fnmatchcase(id, sw): @@ -60,6 +63,9 @@ def warn(kernel, id, text, type=LoopyWarning): warn(text, type) +warn = MovedFunctionDeprecationWrapper(warn_with_kernel) + + # {{{ errors class LoopyError(RuntimeError):