absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
env_copy = os.environ.copy()
- selfBytes= pickle.dumps(self,protocol=0)
- argsBytes= pickle.dumps(args,protocol=0)
- proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","salomeContext.py"), selfBytes.decode(), argsBytes.decode()], shell=False, close_fds=True, env=env_copy)
- proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","salomeContext.py"), pickle.dumps(self), pickle.dumps(args)], shell=False, close_fds=True, env=env_copy)
++ selfBytes= pickle.dumps(self, protocol=0)
++ argsBytes= pickle.dumps(args, protocol=0)
++ proc = subprocess.Popen(['python3', os.path.join(absoluteAppliPath,"bin","salome","salomeContext.py"), selfBytes.decode(), argsBytes.decode()], shell=False, close_fds=True, env=env_copy)
out, err = proc.communicate()
return out, err, proc.returncode
#
try:
res = getattr(self, command)(options) # run appropriate method
return res or 0
- except SystemExit as 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:
++ except SalomeContextException as e:
++ self.getLogger().error(e)
++ return 1
+ except Exception:
self.getLogger().error("Unexpected error:")
import traceback
traceback.print_exc()
return 1
- except SalomeContextException as e:
- except SalomeContextException, e:
-- self.getLogger().error(e)
-- return 1
#
def __setContextFromConfigFile(self, filename, reserved=None):