o
    h<                     @   s.   d dl mZ d dlmZ dedefddZdS )    )import_module)Anydotted_pathreturnc              	   C   sl   z
|  dd\}}W n ty   t|  dw t|}zt||W S  ty5   td| d| dw )a*  
    Import a dotted module path and return the attribute/class designated by the
    last name in the path. Raise ImportError if the import failed.

    Taken from Django:
    https://github.com/django/django/blob/f6bd00131e687aedf2719ad31e84b097562ca5f2/django/utils/module_loading.py#L7-L24
    .   z  doesn't look like a module pathzModule "z" does not define a "z" attribute/class)rsplit
ValueErrorImportErrorr   getattrAttributeError)r   module_path
class_namemodule r   e/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/draftjs_exporter/utils/module_loading.pyimport_string   s   r   N)	importlibr   typingr   strr   r   r   r   r   <module>   s    