X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKERNEL_PY%2Fkernel%2Fuiexception.py;h=702b15863aa799594d8d1a086601a8dbb97fcdb6;hb=c249f953254adaf596bf69169ee42aab1310fa54;hp=d1d2c8e2e38b6292e32e7e3b96d0b16a26124c33;hpb=718e0abe0126e5e53b3ba41fff1028efcf5bc887;p=modules%2Fkernel.git diff --git a/src/KERNEL_PY/kernel/uiexception.py b/src/KERNEL_PY/kernel/uiexception.py index d1d2c8e2e..702b15863 100644 --- a/src/KERNEL_PY/kernel/uiexception.py +++ b/src/KERNEL_PY/kernel/uiexception.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2010-2021 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 @@ -26,7 +26,7 @@ __author__="gboulant" __date__ ="$31 mars 2010 11:59:33$" -from enumerate import Enumerate +from .enumerate import Enumerate ## This exception should be used for functionnal error management, at least in the GUI # part of the application, for example to set user oriented messages at point @@ -66,9 +66,9 @@ class UiException(Exception): def getUIMessage(self): return self._UImessage - ## Specify the type of this exception. To be choosen in the TYPES list. + ## Specify the type of this exception. To be chosen in the TYPES list. def setType(self, type): - """Specify the type of this exception. To be choosen in the TYPES list.""" + """Specify the type of this exception. To be chosen in the TYPES list.""" if not self.TYPES.isValid(type): raise UiException("The exception type "+str(type)+" can't be used",self.TYPES.DEVEL) self._type = type @@ -101,21 +101,21 @@ def TEST_uimessage(): try: somethingGoesWrong() return False - except UiException, err: - print 'ERROR: %s' % str(err) + except UiException as err: + print('ERROR: %s' % str(err)) if ( str(err) == "Something goes wrong" ): return True else: return False def TEST_specificException(): - print DevelException("err") - print AdminException("err") - print UserException("err") + print(DevelException("err")) + print(AdminException("err")) + print(UserException("err")) return True if __name__ == "__main__": - import unittester + from . import unittester unittester.run("uiexception","TEST_uimessage") unittester.run("uiexception","TEST_specificException")