Staging
v0.5.1
https://github.com/python/cpython
Revision df6c8bcffef3380869c8f76317610ce452880b25 authored by Miss Islington (bot) on 28 November 2020, 15:07:51 UTC, committed by GitHub on 28 November 2020, 15:07:51 UTC
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
(cherry picked from commit 8085f742f4adfbc85f13fc734dfab036aa23acfb)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 761c5a1
Raw File
Tip revision: df6c8bcffef3380869c8f76317610ce452880b25 authored by Miss Islington (bot) on 28 November 2020, 15:07:51 UTC
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925) (GH-23539)
Tip revision: df6c8bc
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