Skip to content

Commit 1b64550

Browse files
committed
[OMCPath] differentiate between Windows and Posix for OMCPathCompatibility
1 parent f44f49c commit 1b64550

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

OMPython/OMCSession.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,12 @@ def size(self) -> int:
420420
stacklevel=1,
421421
)
422422

423-
class OMCPathCompatibility(pathlib.Path):
423+
if os.name == 'nt':
424+
pathdef = pathlib.WindowsPath
425+
else:
426+
pathdef = pathlib.PosixPath
427+
428+
class OMCPathCompatibility(pathdef):
424429

425430
def size(self) -> int:
426431
return self.stat().st_size

0 commit comments

Comments
 (0)