INNER CODE UNIT · Python

__getattr__

spyoungtech/ahk · ahk/__init__.py:59

def __getattr__(name: str) -> Any:
    global _global_instance
    if name in dir(AHK):
        if _global_instance is None:
            try:
                _global_instance = AHK()
            except EnvironmentError as init_error:
                raise EnvironmentError(
                    'Tried to create default global AHK instance, but it failed. This is most likely due to AutoHotkey.exe not being available on PATH or other default locations'
                ) from init_error
        return getattr(_global_instance, name)
    raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…