X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Noyau%2FN_utils.py;h=5e1ba24a9004291cbfb991d1434e77c7d81fbebb;hb=8b202e4a0e933f400731a984944bf84aa9a06f48;hp=a0415268258bb0763df100ac90499c6570c2c442;hpb=5a28801efd8fd7e6487d1957dabac40b1f932cb4;p=tools%2Feficas.git diff --git a/Noyau/N_utils.py b/Noyau/N_utils.py index a0415268..5e1ba24a 100644 --- a/Noyau/N_utils.py +++ b/Noyau/N_utils.py @@ -1,5 +1,5 @@ # coding=utf-8 -# Copyright (C) 2007-2017 EDF R&D +# Copyright (C) 2007-2021 EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -27,24 +27,23 @@ from __future__ import absolute_import from __future__ import print_function from __future__ import division try : - from builtins import str - from builtins import object + from builtins import str + from builtins import object except : - pass + pass import sys # Modules EFICAS from .N_Exception import AsException from .N_types import isInt, isFloat, isComplex, isStr, isSequence, isASSD from .strfunc import getEncoding -import six SEP = '_' try : - cur_frame = sys._getframe + cur_frame = sys._getframe except : - print ('pb avec la version de python pour cur_frame = sys._getframe') + print ('pb avec la version de python pour cur_frame = sys._getframe') def calleeWhere(niveau=4): """ @@ -57,6 +56,7 @@ def calleeWhere(niveau=4): # Python 2.7 compile function does not accept unicode filename, so we encode it # with the current locale encoding in order to have a correct traceback. # Here, we convert it back to unicode. + import six filename = six.text_type(frame.f_code.co_filename, getEncoding()) return frame.fLineNo, filename, frame.f_code.co_firstlineno, frame.f_locals except: