From 843d92484df1c19b53d95bac49ea44aeb8e2a784 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Tue, 28 Jun 2022 10:42:48 +0200 Subject: [PATCH] added special deprecation warning error --- openpype/lib/editorial.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openpype/lib/editorial.py b/openpype/lib/editorial.py index 18028c5f06..49220b4f15 100644 --- a/openpype/lib/editorial.py +++ b/openpype/lib/editorial.py @@ -1,7 +1,16 @@ +"""Code related to editorial utility functions was moved +to 'openpype.pipeline.editorial' please change your imports as soon as +possible. File will be probably removed in OpenPype 3.14.* +""" + import warnings import functools +class EditorialDeprecatedWarning(DeprecationWarning): + pass + + def editorial_deprecated(func): """Mark functions as deprecated. @@ -10,12 +19,13 @@ def editorial_deprecated(func): @functools.wraps(func) def new_func(*args, **kwargs): + warnings.simplefilter("always", EditorialDeprecatedWarning) warnings.warn( ( "Call to deprecated function '{}'." " Function was moved to 'openpype.pipeline.editorial'." ).format(func.__name__), - category=DeprecationWarning, + category=EditorialDeprecatedWarning, stacklevel=2 ) return func(*args, **kwargs)