U
    SZf                     @   s>   d Z ddlmZ ddlZddlZeeZe Z	dddZ
dS )zO
Stand-alone module to provide information about whether optional deps exist.

    )import_moduleNTc                 C   sx   |st j| dS | tkrtz
t| W S  tk
rB   t|  Y n2 tk
rr   t|  d|  }t	| Y nX dS )a
  
    Return module or None. Absolute import is required.

    :param (str) name: Dot-separated module path. E.g., 'scipy.stats'.
    :raise: (ImportError) Only when exc_msg is defined.
    :return: (module|None) If import succeeds, the module will be returned.

    Nz Error importing optional module )
sysmodulesget_not_importabler   ImportErroradd	Exceptionlogger	exception)nameZshould_loadmsg r   B/tmp/pip-unpacked-wheel-5ksk5baj/_plotly_utils/optional_imports.py
get_module   s    	


r   )T)__doc__	importlibr   loggingr   	getLogger__name__r
   setr   r   r   r   r   r   <module>   s   
