o
    ¨Ýjä  ã                   @   s|   d dl Z d dlZd dlZd dlZd dlmZ eƒ Zdd„ Zej	d  dk r*ddd„Z
ndd	d„Z
ej	dd
… dkZdd„ ZdS )é    N)Ú	greenletsc                 C   sL   z| j dur
| j W S W n	 ty   Y nw z| jd W S  ty%   Y dS w )ah   Get the error code out of socket.error objects.
    socket.error in <2.5 does not have errno attribute
    socket.error in 3.x does not allow indexing access
    e.args[0] works for all.
    There are cases when args[0] is not errno.
    i.e. http://bugs.python.org/issue6471
    Maybe there are cases when errno is set, but it is not the first argument?
    Nr   )ÚerrnoÚAttributeErrorÚargsÚ
IndexError)Úexc© r   úT/var/www/html/chatgpt/venv/lib/python3.10/site-packages/eventlet/support/__init__.pyÚ	get_errno   s   

ÿÿÿr
   é   Úasciic                 C   s   | S ©Nr   ©ÚbÚencodingr   r   r	   Úbytes_to_str"   s   r   c                 C   s
   |   |¡S r   )Údecoder   r   r   r	   r   %   s   
é   )r   r   c                    s.   dd„ }dj || ƒ||ƒd�‰ ‡ fdd„}|S )Nc                 S   s   d| vrd|  S | S )NÚ.z	eventlet.r   )Úsr   r   r	   Ú_resolve,   s   z!wrap_deprecated.<locals>._resolvez�{old} is deprecated and will be removed in next version. Use {new} instead.
Autoupgrade: fgrep -rl '{old}' . |xargs -t sed --in-place='' -e 's/{old}/{new}/'
)ÚoldÚnewc                    s\   d }t  ˆ ¡rG dd„ dˆ ƒ}ˆ j|_ˆ j|_t ˆ ¡‡ ‡fdd„ƒ}|d ur,||_|S |S )Nc                   @   s   e Zd ZdS )z/wrap_deprecated.<locals>.wrapper.<locals>.klassN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r	   Úklass6   s    r   c                     s   t jˆtdd� ˆ | i |¤ŽS )Né   )Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarning)ÚaÚkw)ÚbaseÚmsgr   r	   Úwrapped;   s   z1wrap_deprecated.<locals>.wrapper.<locals>.wrapped)ÚinspectÚisclassr   r   Ú	functoolsÚwrapsÚ__init__)r$   r   r&   ©r%   )r$   r	   Úwrapper3   s   
z wrap_deprecated.<locals>.wrapper)Úformat)r   r   r   r-   r   r,   r	   Úwrap_deprecated+   s   ýr/   )r   )r'   r)   Úsysr   Zeventlet.supportr   ÚobjectZ_MISSINGr
   Úversion_infor   ZPY33r/   r   r   r   r	   Ú<module>   s    
