Salome HOME
[PATCH] Fix test on return code V8_4_0a2
authorGilles DAVID <gilles-g.david@edf.fr>
Thu, 14 Sep 2017 13:04:40 +0000 (15:04 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Thu, 14 Sep 2017 13:04:40 +0000 (15:04 +0200)
bin/salomeContext.py

index f6c367e6a721b387e40a1dd6133845636407e7c9..073a0e58455137c8d9a8beb5979734a7f73bc0b8 100644 (file)
@@ -261,10 +261,10 @@ class SalomeContext:
     try:
       res = getattr(self, command)(options) # run appropriate method
       return res or 0
-    except SystemExit, returncode:
-      if returncode != 0:
-        self.getLogger().error("SystemExit %s in method %s.", returncode, command)
-      return returncode
+    except SystemExit as ex:
+      if ex.code != 0:
+        self.getLogger().error("SystemExit %s in method %s.", ex.code, command)
+      return ex.code
     except StandardError:
       self.getLogger().error("Unexpected error:")
       import traceback