a
    þd—
  ã                   @   s<   d Z ddlZddlmZ eeƒZG dd„ deƒZdd„ ZdS )z
Note that DeprecationWarnings are ignored by default in Python
2.7/3.2+, so be sure to either un-ignore them in your code, or run
Python with the -Wd flag.
é    N)Úwarnc                       s(   e Zd Z‡ fdd„Z‡ fdd„Z‡  ZS )ÚDeprecatableModulec                    s*   |j }tt| ƒj|d | j |j¡ d S )N)Úname)Ú__name__Úsuperr   Ú__init__Ú__dict__Úupdate)ÚselfÚmoduler   ©Ú	__class__© úZ/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/boltons/deprutils.pyr   1   s    zDeprecatableModule.__init__c                    sb   t t| ƒj}z|dƒ}W n ty4   i  | _}Y n0 ||ƒ}| |¡}|d ur^t|tdd |S )NÚ_deprecated_membersé   )Ú
stacklevel)r   r   Ú__getattribute__ÚAttributeErrorr   Úgetr   ÚDeprecationWarning)r
   r   Zget_attributeZdeprosÚretÚmessager   r   r   r   6   s    
z#DeprecatableModule.__getattribute__)r   Ú
__module__Ú__qualname__r   r   Ú__classcell__r   r   r   r   r   0   s   r   c                 C   s4   t j|  }t|tƒs&t|ƒ t j| < }||j|< d S )N)ÚsysÚmodulesÚ
isinstancer   r   )Úmod_namer   r   r   r   r   r   Údeprecate_module_memberC   s
    


r    )Ú__doc__r   Úwarningsr   ÚtypeÚ
ModuleTyper   r    r   r   r   r   Ú<module>"   s
   