File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -392,21 +392,22 @@ class FastPath:
392392 children.
393393 """
394394
395- path_type = pathlib .Path
396-
397395 def __init__ (self , root ):
398396 self .root = root
399397
398+ def joinpath (self , child ):
399+ return pathlib .Path (self .root , child )
400+
400401 def children (self ):
401402 with suppress (Exception ):
402403 yield from os .listdir (self .root or '' )
403404 with suppress (Exception ):
404405 yield from self .zip_children ()
405406
406407 def zip_children (self ):
407- with zipfile . ZipFile (self .root ) as zf :
408- names = zf .namelist ()
409- self .path_type = zipp . Path
408+ zip_path = zipp . Path (self .root )
409+ names = zip_path . root .namelist ()
410+ self .joinpath = zip_path . joinpath
410411
411412 return (
412413 os .path .split (child )[0 ]
@@ -429,7 +430,7 @@ def search(self, name):
429430 and n_low .endswith (name .suffixes )
430431 # legacy case:
431432 or self .is_egg (name ) and n_low == 'egg-info' ):
432- yield self .path_type ( self . root , child )
433+ yield self .joinpath ( child )
433434
434435
435436class Prepared :
You can’t perform that action at this time.
0 commit comments