]> granicus.if.org Git - python/commitdiff
Remove .pyo files too.
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 6 Sep 2002 20:23:09 +0000 (20:23 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 6 Sep 2002 20:23:09 +0000 (20:23 +0000)
Mac/scripts/zappycfiles.py

index 22a021cab2ffa3369afc1433d0eb2286576b7c98..dcd41334c6758d2a832bb012b81e8a4b8d01359b 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-"""Recursively zap all .pyc files"""
+"""Recursively zap all .pyc and .pyo files"""
 import os
 import sys
 
@@ -27,7 +27,7 @@ def zappyc(dir):
        
 def walker(dummy, top, names):
        for name in names:
-               if name[-4:] == '.pyc':
+               if name[-4:] in ('.pyc', '.pyo'):
                        path = os.path.join(top, name)
                        print 'Zapping', path
                        if doit: