Staging
v0.5.1
https://github.com/python/cpython
Revision a96e938fc3e266a56d8cebc53687eb2fd56e7589 authored by Kyle Stanley on 17 December 2019, 04:01:19 UTC, committed by Ned Deily on 17 December 2019, 04:01:19 UTC
(cherry picked from commit f501db2b93a9d3d840b6fb38d6bdda8bcc400d4a)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
1 parent 8d0f369
Raw File
Tip revision: a96e938fc3e266a56d8cebc53687eb2fd56e7589 authored by Kyle Stanley on 17 December 2019, 04:01:19 UTC
[3.8] Add whatsnew for removal of asyncio.loop.create_datagram_endpoint()'s *reuse_address* parameter (GH-17595). (#17630)
Tip revision: a96e938
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