Staging
v0.5.1
https://github.com/python/cpython
Revision 66807853b439ceb3a119256ebb6b7187abf6aed2 authored by Eric Smith on 24 February 2010, 14:27:37 UTC, committed by Eric Smith on 24 February 2010, 14:27:37 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78418 | eric.smith | 2010-02-24 09:15:36 -0500 (Wed, 24 Feb 2010) | 1 line

  Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
........
1 parent 5b06ecf
Raw File
Tip revision: 66807853b439ceb3a119256ebb6b7187abf6aed2 authored by Eric Smith on 24 February 2010, 14:27:37 UTC
Merged revisions 78418 via svnmerge from
Tip revision: 6680785
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