hotpocket/services/packages/common/hotpocket_common/loader.py
Tomek Wójcik b4338e2769
Some checks failed
CI / Checks (push) Failing after 13m2s
Release v1.0.0
2025-08-20 21:00:50 +02:00

16 lines
346 B
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
import importlib
import typing
def load_module_attribute(import_path: str) -> typing.Any:
module_path, attribute = import_path.split(':')
module = importlib.import_module(module_path)
if attribute is not None:
return getattr(module, attribute)
return module