diff --git a/OMPython/ModelicaSystem.py b/OMPython/ModelicaSystem.py index c7e382d6..8979d14a 100644 --- a/OMPython/ModelicaSystem.py +++ b/OMPython/ModelicaSystem.py @@ -473,14 +473,14 @@ def setTempDirectory(self, customBuildDirectory: Optional[str | os.PathLike | pa if customBuildDirectory is not None: if not os.path.exists(customBuildDirectory): raise IOError(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(tempdir, " cannot 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