@@ -387,7 +387,9 @@ class PathPlus(pathlib.Path):
387
387
"""
388
388
389
389
__slots__ = ()
390
- _accessor = pathlib ._normal_accessor # type: ignore
390
+
391
+ if sys .version_info < (3 , 11 ):
392
+ _accessor = pathlib ._normal_accessor # type: ignore
391
393
_closed = False
392
394
393
395
def _init (self , * args , ** kwargs ):
@@ -757,7 +759,7 @@ def rename(self: _P, target: Union[str, pathlib.PurePath]) -> _P: # type: ignor
757
759
:returns: The new Path instance pointing to the target path.
758
760
"""
759
761
760
- self . _accessor .rename (self , target ) # type: ignore
762
+ os .rename (self , target ) # type: ignore
761
763
return self .__class__ (target )
762
764
763
765
def replace (self : _P , target : Union [str , pathlib .PurePath ]) -> _P : # type: ignore
@@ -778,7 +780,7 @@ def replace(self: _P, target: Union[str, pathlib.PurePath]) -> _P: # type: igno
778
780
:returns: The new Path instance pointing to the target path.
779
781
"""
780
782
781
- self . _accessor .replace (self , target ) # type: ignore
783
+ os .replace (self , target ) # type: ignore
782
784
return self .__class__ (target )
783
785
784
786
def unlink (self , missing_ok : bool = False ) -> None :
@@ -792,7 +794,7 @@ def unlink(self, missing_ok: bool = False) -> None:
792
794
"""
793
795
794
796
try :
795
- self . _accessor .unlink (self )
797
+ os .unlink (self )
796
798
except FileNotFoundError :
797
799
if not missing_ok :
798
800
raise
0 commit comments