Commit 192b2ea 1 parent 7b580a5 commit 192b2ea Copy full SHA for 192b2ea
File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -90,16 +90,12 @@ def fs_walk(
90
90
yield '' , [], []
91
91
return
92
92
93
- for info in listing :
93
+ for is_dir , name in ((info ['type' ] == 'directory' , info ['name' ])
94
+ for info in listing ):
94
95
# each info name must be at least [path]/part , but here
95
96
# we check also for names like [path]/part/
96
- pathname : str = info ['name' ].rstrip (SEPARATOR )
97
- name : str = pathname .rsplit (SEPARATOR , 1 )[- 1 ]
98
- if info ['type' ] == 'directory' and pathname != path :
99
- # do not include "self" path
100
- dirs .append (pathname )
101
- else :
102
- files .append (name )
97
+ dirs .append (name ) if is_dir else files .append (
98
+ name .rsplit (SEPARATOR , 1 )[- 1 ])
103
99
104
100
def sort_sequence (sequence : list [str ]) -> list [str ]:
105
101
"""Sort the sequence if the user wishes."""
You can’t perform that action at this time.
0 commit comments