Files
blender-portable-repo/extensions/.local/lib/python3.11/site-packages/dlinfo/_macosx.py
T
2026-03-17 14:58:51 -06:00

22 lines
523 B
Python

import ctypes
# pylint: disable=import-error,no-name-in-module
from ctypes.macholib.dyld import dyld_find
class DLInfo: # pylint: disable=too-few-public-methods
"""
>>> lib = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
>>> dlinfo = DLInfo(lib)
>>> dlinfo.path
'/usr/lib/libc.dylib'
"""
def __init__(self, cdll: ctypes.CDLL):
self._cdll = cdll
@property
def path(self) -> str:
# pylint: disable=protected-access
return dyld_find(self._cdll._name)