Staging
v0.8.1
https://github.com/python/cpython
Revision 19b2890014d3098147d16475c492a47a43893768 authored by Dong-hee Na on 26 July 2017, 07:04:42 UTC, committed by Ned Deily on 26 July 2017, 07:04:42 UTC
1 parent 49175b3
Raw File
Tip revision: 19b2890014d3098147d16475c492a47a43893768 authored by Dong-hee Na on 26 July 2017, 07:04:42 UTC
[3.5] [security] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214) (#2887)
Tip revision: 19b2890
rmpyc.py
# Remove all the .pyc files under ../Lib.


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

    npyc = 0
    for root, dirs, files in os.walk(root):
        for name in files:
            # to be thorough
            if name.endswith(('.pyc', '.pyo')):
                npyc += 1
                os.remove(join(root, name))

    return npyc

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