MCPcopy
hub / github.com/pyinstaller/pyinstaller / _which_library

Function _which_library

PyInstaller/depend/bindepend.py:828–845  ·  view source on GitHub ↗

Search for a shared library in a list of directories. Args: name: The library name including the `lib` prefix but excluding any `.so` suffix. dirs: An iterable of folders to search in. Returns: The path to the library if found or None oth

(name, dirs)

Source from the content-addressed store, hash-verified

826
827
828def _which_library(name, dirs):
829 """
830 Search for a shared library in a list of directories.
831
832 Args:
833 name:
834 The library name including the `lib` prefix but excluding any `.so` suffix.
835 dirs:
836 An iterable of folders to search in.
837 Returns:
838 The path to the library if found or None otherwise.
839
840 """
841 matcher = _library_matcher(name)
842 for path in filter(os.path.exists, dirs):
843 for _path in os.listdir(path):
844 if matcher(_path):
845 return os.path.join(path, _path)
846
847
848def _library_matcher(name):

Callers

nothing calls this directly

Calls 2

_library_matcherFunction · 0.85
listdirMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…