Staging
v0.5.1
https://github.com/python/cpython
Revision e1b690370fd8f93bef1e69eeea2695f95a7cfff5 authored by Nick Coghlan on 12 June 2017, 12:28:12 UTC, committed by GitHub on 12 June 2017, 12:28:12 UTC
While the build changes won't affect most users,
they may affect redistributors and folks building
their own Python binaries from source.
1 parent d89dc84
Raw File
Tip revision: e1b690370fd8f93bef1e69eeea2695f95a7cfff5 authored by Nick Coghlan on 12 June 2017, 12:28:12 UTC
bpo-23404: `make regen-all` What's New entry (#2128)
Tip revision: e1b6903
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