Skip to content

Commit 7df431e

Browse files
committed
[OMCPath] only working for Python >= 3.12
1 parent d5445c6 commit 7df431e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

OMPython/OMCSession.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,12 @@ def __del__(self):
370370
def omcpath(self, *path) -> OMCPath:
371371
# TODO: need to handle PurePosixPath and PureWindowsPath
372372
# define it here based on the backend (omc_process) used?
373+
374+
if sys.version_info < (3, 12):
375+
raise OMCSessionException("OMCPath requires Python 3.12 or newer!")
376+
# reason (3.11): TypeError: PurePath.__new__() got an unexpected keyword argument 'session'
377+
# reason (3.10): TypeError: PurePath.__new__() got an unexpected keyword argument 'session'
378+
373379
return OMCPath(*path, session=self)
374380

375381
def execute(self, command: str):

0 commit comments

Comments
 (0)