U
    uh<                     @   s,   d dl mZ d dlmZ eedddZdS )    )import_module)Any)dotted_pathreturnc              	   C   s|   z|  dd\}}W n" tk
r6   t|  dY nX t|}zt||W S  tk
rv   td| d| dY nX dS )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/classN)rsplit
ValueErrorImportErrorr   getattrAttributeError)r   module_path
class_namemodule r   m/var/www/dating/data/www/fatepal.com/env/lib/python3.8/site-packages/draftjs_exporter/utils/module_loading.pyimport_string   s    r   N)	importlibr   typingr   strr   r   r   r   r   <module>   s   