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)
| 826 | |
| 827 | |
| 828 | def _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 | |
| 848 | def _library_matcher(name): |
nothing calls this directly
no test coverage detected
searching dependent graphs…