Skip to content

Commit 7a50441

Browse files
committed
[OMCSEssionZMQ] use OMCpath
1 parent 1acd916 commit 7a50441

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

OMPython/OMCSession.py

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

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

488495
def execute(self, command: str):

0 commit comments

Comments
 (0)