Salome HOME
Copyright update 2022
[modules/kernel.git] / bin / appliskel / tests / salomeCommand / TestLauncherSessionArgs.py
old mode 100644 (file)
new mode 100755 (executable)
index d6cd975..177d66d
@@ -1,4 +1,5 @@
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+#!/usr/bin/env python3
+# Copyright (C) 2013-2022  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
@@ -22,7 +23,7 @@ import unittest
 import os
 import sys
 import imp
-from cStringIO import StringIO
+from io import StringIO
 import logging
 
 logger = logging.getLogger("TestLauncherLogger")
@@ -57,6 +58,8 @@ class TestSessionArgs(unittest.TestCase):
   def setUp(self):
     import tempfile
     self.logFile = tempfile.NamedTemporaryFile()
+    if sys.platform == "win32": # Close file because of permission denined on Windows
+        self.logFile.close()
   #
   def tearDown(self):
     self.logFile.close()
@@ -71,7 +74,7 @@ class TestSessionArgs(unittest.TestCase):
       import runSession
       params, args = runSession.configureSession(args, exe="salome shell")
       return runSession.runSession(params, args)
-    except SystemExit, e:
+    except SystemExit as e:
       if str(e) != '0':
         logger.error(e)
       import traceback