Skip to content

Commit 08a8500

Browse files
syntronadeas31
andauthored
[ModelicaSystem] use absolute path for tempdir (#303)
Co-authored-by: Adeel Asghar <[email protected]>
1 parent 083c351 commit 08a8500

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OMPython/ModelicaSystem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,14 @@ def setTempDirectory(self, customBuildDirectory: Optional[str | os.PathLike | pa
476476
if customBuildDirectory is not None:
477477
if not os.path.exists(customBuildDirectory):
478478
raise IOError(f"{customBuildDirectory} does not exist")
479-
tempdir = pathlib.Path(customBuildDirectory)
479+
tempdir = pathlib.Path(customBuildDirectory).absolute()
480480
else:
481-
tempdir = pathlib.Path(tempfile.mkdtemp())
481+
tempdir = pathlib.Path(tempfile.mkdtemp()).absolute()
482482
if not tempdir.is_dir():
483483
raise IOError(f"{tempdir} could not be created")
484484

485485
logger.info("Define tempdir as %s", tempdir)
486-
exp = f'cd("{tempdir.absolute().as_posix()}")'
486+
exp = f'cd("{tempdir.as_posix()}")'
487487
self.sendExpression(exp)
488488

489489
return tempdir

0 commit comments

Comments
 (0)