[Zope-Checkins] CVS: Zope2 - walkandscrub.py:1.3
shane@digicool.com
shane@digicool.com
Mon, 16 Apr 2001 13:27:17 -0400 (EDT)
Update of /cvs-repository/Zope2/inst
In directory korak:/tmp/cvs-serv3667
Modified Files:
walkandscrub.py
Log Message:
Remove deleted files from the file list so walk() can continue.
--- Updated File walkandscrub.py in package Zope2 --
--- walkandscrub.py 2001/04/12 16:57:48 1.2
+++ walkandscrub.py 2001/04/16 17:27:16 1.3
@@ -99,10 +99,10 @@
print
print '-'*78
sys.stdout.write(
- "Deleting '.pyc' and '.pyo' files recursively under %s... " % path
+ "Deleting '.pyc' and '.pyo' files recursively under %s...\n" % path
)
os.path.walk(path, scrub, [])
- sys.stdout.write('done.\n')
+ sys.stdout.write('Done.\n')
def scrub(list, dirname, filelist):
for name in filelist:
@@ -112,6 +112,7 @@
if ext == '.pyo' or ext == '.pyc':
full = os.path.join(dirname, name)
os.unlink(full)
+ filelist.remove(name)
if DEBUG: print full
if __name__ == '__main__':