File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -587,13 +587,14 @@ def iterdir(self):
587
587
def _scandir (self ):
588
588
return os .scandir (self )
589
589
590
- def _entry_str (self , entry ):
590
+ @classmethod
591
+ def _entry_str (cls , entry ):
591
592
# Transform an entry yielded from _scandir() into a path string.
592
- return entry .name if str ( self ) == '.' else entry . path
593
+ return entry .path
593
594
594
595
def _make_child_entry (self , entry ):
595
596
# Transform an entry yielded from _scandir() into a path object.
596
- path_str = self . _entry_str ( entry )
597
+ path_str = entry . name if str ( self ) == '.' else entry . path
597
598
path = self .with_segments (path_str )
598
599
path ._str = path_str
599
600
path ._drv = self .drive
Original file line number Diff line number Diff line change @@ -753,7 +753,8 @@ def _scandir(self):
753
753
from contextlib import nullcontext
754
754
return nullcontext (self .iterdir ())
755
755
756
- def _entry_str (self , entry ):
756
+ @classmethod
757
+ def _entry_str (cls , entry ):
757
758
# Transform an entry yielded from _scandir() into a path string.
758
759
return str (entry )
759
760
You can’t perform that action at this time.
0 commit comments