Skip to content

Commit afb8511

Browse files
committed
[OMCSEssionZMQ] use OMCpath
1 parent aa5e36a commit afb8511

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

OMPython/OMCSession.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,15 @@ def __del__(self):
478478
self.omc_zmq = None
479479

480480
def omcpath(self, *path) -> OMCPath:
481-
# TODO: need to handle PurePosixPath and PureWindowsPath
482-
# define it here based on the backend (omc_process) used?
481+
"""
482+
Create an OMCPath object based on the given path segments and the current OMC session.
483+
"""
484+
485+
# fallback solution for Python < 3.12; a modified pathlib.Path object is used as OMCPath replacement
486+
if sys.version_info < (3, 12):
487+
# noinspection PyArgumentList
488+
return OMCPath(*path)
489+
483490
return OMCPath(*path, session=self)
484491

485492
def execute(self, command: str):

0 commit comments

Comments
 (0)