contrib/import-checker.py
changeset 20201 bc3b48b0f5c8
parent 20200 532fa12033e1
child 20238 81e905790b30
equal deleted inserted replaced
20200:532fa12033e1 20201:bc3b48b0f5c8
    69                 # Then this directory is redundant.
    69                 # Then this directory is redundant.
    70                 break
    70                 break
    71         else:
    71         else:
    72             stdlib_prefixes.add(dirname)
    72             stdlib_prefixes.add(dirname)
    73     for libpath in sys.path:
    73     for libpath in sys.path:
    74         # We want to walk everything in sys.path that starts with something
    74         # We want to walk everything in sys.path that starts with
    75         # in stdlib_prefixes.
    75         # something in stdlib_prefixes. check-code suppressed because
    76         if not any(libpath.startswith(p) for p in stdlib_prefixes):
    76         # the ast module used by this script implies the availability
       
    77         # of any().
       
    78         if not any(libpath.startswith(p) for p in stdlib_prefixes): # no-check-code
    77             continue
    79             continue
    78         if 'site-packages' in libpath:
    80         if 'site-packages' in libpath:
    79             continue
    81             continue
    80         for top, dirs, files in os.walk(libpath):
    82         for top, dirs, files in os.walk(libpath):
    81             for name in files:
    83             for name in files: