MCPcopy Index your code
hub / github.com/python/cpython / lib_platform_files

Function lib_platform_files

Platforms/Apple/__main__.py:472–500  ·  view source on GitHub ↗

A file filter that ignores platform-specific files in lib.

(dirname, names)

Source from the content-addressed store, hash-verified

470
471
472def lib_platform_files(dirname, names):
473 """A file filter that ignores platform-specific files in lib."""
474 path = Path(dirname)
475 if (
476 path.parts[-3] == "lib"
477 and path.parts[-2].startswith("python")
478 and path.parts[-1] == "lib-dynload"
479 ):
480 return names
481 elif path.parts[-2] == "lib" and path.parts[-1].startswith("python"):
482 ignored_names = {
483 name
484 for name in names
485 if (
486 name.startswith("_sysconfigdata_")
487 or name.startswith("_sysconfig_vars_")
488 or name == "build-details.json"
489 )
490 }
491 elif path.parts[-1] == "lib":
492 ignored_names = {
493 name
494 for name in names
495 if name.startswith("libpython") and name.endswith(".dylib")
496 }
497 else:
498 ignored_names = set()
499
500 return ignored_names
501
502
503def lib_non_platform_files(dirname, names):

Callers 1

lib_non_platform_filesFunction · 0.85

Calls 4

PathClass · 0.90
setFunction · 0.85
startswithMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…