X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKERNEL_PY%2Fkernel%2Fdeprecation.py;h=81c82d495226849e4de46734f398016468c97c65;hb=dac5e4d5c8f771e0cedb7caa5292bc54be5ca89a;hp=588b4162566975eba2fa75123a91ddf0b39d2787;hpb=0fac7040be417aab7228a4e23904b4cf22a8dda4;p=modules%2Fkernel.git diff --git a/src/KERNEL_PY/kernel/deprecation.py b/src/KERNEL_PY/kernel/deprecation.py index 588b41625..81c82d495 100644 --- a/src/KERNEL_PY/kernel/deprecation.py +++ b/src/KERNEL_PY/kernel/deprecation.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -149,7 +149,9 @@ def is_called_by_sphinx(): def __show_colored_warning(message, category, filename, - lineno, file = sys.stderr, line = None): + lineno, file = None, line = None): + if file is None: + file = sys.stderr str = warnings.formatwarning(message, category, filename, lineno, line) if category == DeprecationWarning and termcolor.canDisplayColor(file): file.write(termcolor.makeColoredMessage(str, termcolor.BLUE))