@@ -387,7 +387,9 @@ class PathPlus(pathlib.Path):
387387 """
388388
389389 __slots__ = ()
390- _accessor = pathlib ._normal_accessor # type: ignore
390+
391+ if sys .version_info < (3 , 11 ):
392+ _accessor = pathlib ._normal_accessor # type: ignore
391393 _closed = False
392394
393395 def _init (self , * args , ** kwargs ):
@@ -757,7 +759,7 @@ def rename(self: _P, target: Union[str, pathlib.PurePath]) -> _P: # type: ignor
757759 :returns: The new Path instance pointing to the target path.
758760 """
759761
760- self . _accessor .rename (self , target ) # type: ignore
762+ os .rename (self , target ) # type: ignore
761763 return self .__class__ (target )
762764
763765 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
778780 :returns: The new Path instance pointing to the target path.
779781 """
780782
781- self . _accessor .replace (self , target ) # type: ignore
783+ os .replace (self , target ) # type: ignore
782784 return self .__class__ (target )
783785
784786 def unlink (self , missing_ok : bool = False ) -> None :
@@ -792,7 +794,7 @@ def unlink(self, missing_ok: bool = False) -> None:
792794 """
793795
794796 try :
795- self . _accessor .unlink (self )
797+ os .unlink (self )
796798 except FileNotFoundError :
797799 if not missing_ok :
798800 raise
0 commit comments