hotpocket/services/packages/common/hotpocket_common/loader.py
Tomek Wójcik d909391ee6
Some checks failed
CI / Checks (push) Has been cancelled
Release v1.0.0rc1
2025-08-18 07:09:27 +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