From 447e4239cc1ad4db1ec679e8fa7c63facbda3af6 Mon Sep 17 00:00:00 2001 From: syntron Date: Sat, 21 Dec 2024 12:17:55 +0100 Subject: [PATCH 1/2] [ModelicaSystem] remove last print() command --- OMPython/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/__init__.py b/OMPython/__init__.py index ff9b9c3e4..1b776be9c 100644 --- a/OMPython/__init__.py +++ b/OMPython/__init__.py @@ -801,7 +801,7 @@ def _run_cmd(self, cmd: list): # set the process environment from the generated .bat file in windows which should have all the dependencies batFilePath = os.path.join(self.tempdir, '{}.{}'.format(self.modelName, "bat")).replace("\\", "/") if (not os.path.exists(batFilePath)): - print("Error: bat does not exist " + batFilePath) + ModelicaSystemError("Batch file (*.bat) does not exist " + batFilePath) with open(batFilePath, 'r') as file: for line in file: From 57100ae2f572f6c52eb87d9679304b21c6567b46 Mon Sep 17 00:00:00 2001 From: syntron Date: Sat, 21 Dec 2024 12:18:16 +0100 Subject: [PATCH 2/2] [OMCSessionBase] remove last print() command; replace by logger.warning() --- OMPython/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMPython/__init__.py b/OMPython/__init__.py index 1b776be9c..f78f86625 100644 --- a/OMPython/__init__.py +++ b/OMPython/__init__.py @@ -177,7 +177,7 @@ def __del__(self): break # kill self._omc_process process if it is still running/exists if self._omc_process is not None and self._omc_process.returncode is None: - print("OMC did not exit after being sent the quit() command; killing the process with pid=%s" % str(self._omc_process.pid)) + logger.warning("OMC did not exit after being sent the quit() command; killing the process with pid=%s" % str(self._omc_process.pid)) if sys.platform == "win32": self._omc_process.kill() self._omc_process.wait()