Staging
v0.5.1
https://github.com/python/cpython
Revision 003c9e29520a24da7177f16fe26e758c6baeaaca authored by Neal Norwitz on 11 August 2006, 06:09:41 UTC, committed by Neal Norwitz on 11 August 2006, 06:09:41 UTC
The first hunk changes the colon to an ! like other Windows variants.
We need to always wait on the child so the lock gets released and
no other tests fail.  This is the try/finally in the second hunk.
1 parent 8b8c59c
Raw File
Tip revision: 003c9e29520a24da7177f16fe26e758c6baeaaca authored by Neal Norwitz on 11 August 2006, 06:09:41 UTC
Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).
Tip revision: 003c9e2
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