From: barate Date: Wed, 9 Nov 2011 15:11:15 +0000 (+0000) Subject: Fix bug with Python 2.7 and update doc in module deprecation X-Git-Tag: RELIQUAT_6x_15112011~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7ce5142bb566948dac8237b845bc07cc683898c1;p=modules%2Fkernel.git Fix bug with Python 2.7 and update doc in module deprecation --- diff --git a/src/KERNEL_PY/kernel/deprecation.py b/src/KERNEL_PY/kernel/deprecation.py index 9d53be0e2..c571d0812 100644 --- a/src/KERNEL_PY/kernel/deprecation.py +++ b/src/KERNEL_PY/kernel/deprecation.py @@ -21,6 +21,16 @@ """ This module provides several functions to indicate the deprecation of a module, a method or a function. + +Example:: + + from salome.kernel.deprecation import deprecated + + @deprecated("Deprecated since version 6.3.0. Consider replacement with " + "newFunction()") + def oldFunction(): + ... + """ import sys @@ -112,4 +122,8 @@ def __show_colored_warning(message, category, filename, else: file.write(str) +# Enable warnings for deprecated functions and modules (in Python 2.7, they +# are disabled by default) +warnings.filterwarnings("always", "Call to *", DeprecationWarning) +warnings.filterwarnings("always", "Importation of *", DeprecationWarning) warnings.showwarning = __show_colored_warning