Skip to content

Commit a5f2ad6

Browse files
committed
[OMCPath] try to make mypy happy ...
1 parent 3029138 commit a5f2ad6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

OMPython/OMCSession.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def getClassNames(self, className=None, recursive=False, qualified=False, sort=F
268268
return self._ask(question='getClassNames', opt=opt)
269269

270270

271-
class OMCPath(pathlib.PurePosixPath):
271+
class OMCPathReal(pathlib.PurePosixPath):
272272
"""
273273
Implementation of a basic Path object which uses OMC as backend. The connection to OMC is provided via a
274274
OMCSessionZMQ session object.
@@ -420,13 +420,16 @@ def size(self) -> int:
420420
stacklevel=1,
421421
)
422422

423-
class OMCPathCompatibility(pathlib.Path):
423+
class OMCPathCompatibility(pathlib.PosixPath):
424424

425425
def size(self) -> int:
426426
return self.stat().st_size
427427

428428
OMCPath = OMCPathCompatibility # noqa: F811
429429

430+
else:
431+
OMCPath = OMCPathReal
432+
430433

431434
class OMCSessionZMQ:
432435

@@ -491,8 +494,8 @@ def omcpath(self, *path) -> OMCPath:
491494
if sys.version_info < (3, 12):
492495
# noinspection PyArgumentList
493496
return OMCPath(*path)
494-
495-
return OMCPath(*path, session=self)
497+
else:
498+
return OMCPath(*path, session=self)
496499

497500
def omcpath_tempdir(self) -> OMCPath:
498501
"""

0 commit comments

Comments
 (0)