File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ def size(self) -> int:
415415
416416if sys .version_info < (3 , 12 ):
417417
418- class OMCPathCompatibility :
418+ class OMCPathCompatibility ( pathlib . PurePath ) :
419419 """
420420 Compatibility class for OMCPath in Python < 3.12. This allows to run all code which uses OMCPath (mainly
421421 ModelicaSystem) on these Python versions. There is one remaining limitation: only OMCProcessLocal will work as
@@ -438,7 +438,10 @@ def size(self) -> int:
438438 """
439439 Needed compatibility function to have the same interface as OMCPathReal
440440 """
441- return self .stat ().st_size
441+ if hasattr (self , stat ) and callable (self .stat ):
442+ return self .stat ().st_size
443+
444+ raise OMCSessionException ("Missing stat()" )
442445
443446 class OMCPathCompatibilityPosix (pathlib .PosixPath , OMCPathCompatibility ):
444447 pass
You can’t perform that action at this time.
0 commit comments