From 50768a5c8910336d26ee17a48e0d90e4517624ae Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 4 Jun 2016 19:47:20 -0500 Subject: [PATCH] Deprecate 'warn', move to 'warn_with_kernel' --- loopy/diagnostic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/loopy/diagnostic.py b/loopy/diagnostic.py index 2ea1bd40e..c1d0e0363 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): -- GitLab