@@ -156,11 +156,11 @@ def onerror(fun, path, excinfo):
156156 safe_remove (pattern )
157157 return
158158
159- for root , subdirs , subfiles in os .walk ('.' ):
159+ for root , dirs , files in os .walk ('.' ):
160160 root = os .path .normpath (root )
161161 if root .startswith ('.git/' ):
162162 continue
163- found = fnmatch .filter (subdirs if directory else subfiles , pattern )
163+ found = fnmatch .filter (dirs if directory else files , pattern )
164164 for name in found :
165165 path = os .path .join (root , name )
166166 if directory :
@@ -195,15 +195,15 @@ def onerror(fun, path, excinfo):
195195
196196def recursive_rm (* patterns ):
197197 """Recursively remove a file or matching a list of patterns."""
198- for root , subdirs , subfiles in os .walk (u'.' ):
198+ for root , dirs , files in os .walk (u'.' ):
199199 root = os .path .normpath (root )
200200 if root .startswith ('.git/' ):
201201 continue
202- for file in subfiles :
202+ for file in files :
203203 for pattern in patterns :
204204 if fnmatch .fnmatch (file , pattern ):
205205 safe_remove (os .path .join (root , file ))
206- for dir in subdirs :
206+ for dir in dirs :
207207 for pattern in patterns :
208208 if fnmatch .fnmatch (dir , pattern ):
209209 safe_rmtree (os .path .join (root , dir ))
0 commit comments