Staging
v0.5.1
https://github.com/python/cpython
Revision 9291332de137141057591386b4ba449ae3a5ed48 authored by Andrew MacIntyre on 13 June 2006, 15:04:24 UTC, committed by Andrew MacIntyre on 13 June 2006, 15:04:24 UTC
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481

branch tested on buildbots (Windows buildbots had problems
not related to these changes).
1 parent c6f5b3a
Raw File
Tip revision: 9291332de137141057591386b4ba449ae3a5ed48 authored by Andrew MacIntyre on 13 June 2006, 15:04:24 UTC
Patch #1454481: Make thread stack size runtime tunable.
Tip revision: 9291332
rmpyc.py
# Remove all the .pyc and .pyo files under ../Lib.


def deltree(root):
    import os
    from os.path import join

    npyc = npyo = 0
    for root, dirs, files in os.walk(root):
        for name in files:
            delete = False
            if name.endswith('.pyc'):
                delete = True
                npyc += 1
            elif name.endswith('.pyo'):
                delete = True
                npyo += 1

            if delete:
                os.remove(join(root, name))

    return npyc, npyo

npyc, npyo = deltree("../Lib")
print npyc, ".pyc deleted,", npyo, ".pyo deleted"
back to top