diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index f616672be..f74e3f5b0 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -476,14 +476,14 @@ def setTempDirectory(self, customBuildDirectory: Optional[str | os.PathLike | pa if customBuildDirectory is not None: if not os.path.exists(customBuildDirectory): raise IOError(f"{customBuildDirectory} does not exist") - tempdir = pathlib.Path(customBuildDirectory) + tempdir = pathlib.Path(customBuildDirectory).absolute() else: - tempdir = pathlib.Path(tempfile.mkdtemp()) + tempdir = pathlib.Path(tempfile.mkdtemp()).absolute() if not tempdir.is_dir(): raise IOError(f"{tempdir} could not be created") logger.info("Define tempdir as %s", tempdir) - exp = f'cd("{tempdir.absolute().as_posix()}")' + exp = f'cd("{tempdir.as_posix()}")' self.sendExpression(exp) return tempdir