Staging
v0.5.1
https://github.com/python/cpython
Revision c598a04dd29b89ad072245ddaf738badcfb41ac7 authored by idanw206 on 06 December 2020, 09:59:36 UTC, committed by GitHub on 06 December 2020, 09:59:36 UTC
Check if NonCallableMock's spec_arg is not None instead of call its __bool__ function
1 parent 804d689
Raw File
Tip revision: c598a04dd29b89ad072245ddaf738badcfb41ac7 authored by idanw206 on 06 December 2020, 09:59:36 UTC
bpo-42532: Check if NonCallableMock's spec_arg is not None instead of call its __bool__ function (GH23613)
Tip revision: c598a04
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