Skip to content
Snippets Groups Projects
Commit 50768a5c authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Deprecate 'warn', move to 'warn_with_kernel'

parent d8c45494
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,9 @@ THE SOFTWARE. ...@@ -23,6 +23,9 @@ THE SOFTWARE.
""" """
from pytools import MovedFunctionDeprecationWrapper
# {{{ warnings # {{{ warnings
class LoopyWarningBase(UserWarning): class LoopyWarningBase(UserWarning):
...@@ -47,7 +50,7 @@ class WriteRaceConditionWarning(LoopyWarning): ...@@ -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 from fnmatch import fnmatchcase
for sw in kernel.silenced_warnings: for sw in kernel.silenced_warnings:
if fnmatchcase(id, sw): if fnmatchcase(id, sw):
...@@ -60,6 +63,9 @@ def warn(kernel, id, text, type=LoopyWarning): ...@@ -60,6 +63,9 @@ def warn(kernel, id, text, type=LoopyWarning):
warn(text, type) warn(text, type)
warn = MovedFunctionDeprecationWrapper(warn_with_kernel)
# {{{ errors # {{{ errors
class LoopyError(RuntimeError): class LoopyError(RuntimeError):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment