Salome HOME
EDF bug 17743, salome.sg regressions in DEV (missing getAllSelected method)
[modules/kernel.git] / bin / runSession.py
index 9280c09d51870ec441fe81e95be35c698da172ae..c6676b8020708a55a737aae2ddb030d8a626cae1 100644 (file)
@@ -159,7 +159,7 @@ User "myself" connects to remotemachine to run the script concatenate.py in
   os.environ['NSPORT'] = port
   os.environ['NSHOST'] = host
 
-  # determine running mode, taht is either 'local' or 'remote'
+  # determine running mode, that is either 'local' or 'remote'
   here = getShortHostName()
   mode = "local"
   if host != here and host != "localhost" and host != "no_host":
@@ -193,6 +193,7 @@ def __runLocalSession(command):
     for cmd in command:
       single_cmd = cmd.strip().split(' ')
       any_error = False
+      error_code = 1
       try:
         proc = subprocess.Popen(single_cmd)
         (stdoutdata, stderrdata) = proc.communicate() # Wait for process to terminate
@@ -203,6 +204,7 @@ def __runLocalSession(command):
 
         if proc.returncode != 0:
           any_error = True
+          error_code = proc.returncode
       except:
           any_error = True
           pass
@@ -213,7 +215,7 @@ def __runLocalSession(command):
           sys.stdout.write("".join(outmsg))
         if errmsg:
           sys.stderr.write("".join(errmsg))
-        sys.exit(1)
+        sys.exit(error_code)
 
     return 0
   else: