AlkantarClanX12

Your IP : 18.221.93.167


Current Path : /opt/alt/python37/lib/python3.7/site-packages/raven/utils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/utils/__pycache__/compat.cpython-37.pyc

B

��Y,�@s�dZddlmZddlZddlZddlZejddkZejddkZerde	fZ
efZe
fZe	ZeZn efZ
eefZe
ejfZeZe	ZyeZWnek
r�dd�ZYnXeZyeZWnek
r�dd	�ZYnXer�eZnGd
d�de�Ze�rdd
�Zdd�Zdd�Zdd�Zn dd
�Zdd�Zdd�Zdd�Ze�rbdd�Z dd�Z!ddl"Z"e"j#Z#e"j$Z$n"dd�Z dd�Z!ddl#Z#e#j#Z#Z$e�r�e%e&d�d�Z'd3d d!�Z(nd4d"d#�Z'e'd$�ejdd�d%k�r�e'd&�n&ejdd�d%k�r�e'd'�nd(d)�Z)e�rJdd*l*m+Z+dd+l,m-Z.ddl/m0Z1dd,l2m3Z3dd-l4m5Z6dd.l7m8Z9n<dd*l1m+Z+ddl.Z.ddl1Z1dd,l3m3Z3dd-l7m5Z6ddl9Z9d/d0�Z:d1d2�Z;dS)5z�
raven.utils.compat
~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2016 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.

Utilities for writing code that runs on Python 2 and 3
�)�absolute_importN��cCs|��S)N)�next)�it�r�C/opt/alt/python37/lib/python3.7/site-packages/raven/utils/compat.py�advance_iterator:sr	cCstdd�t|�jD��S)Ncss|]}d|jkVqdS)�__call__N)�__dict__)�.0�klassrrr�	<genexpr>Cszcallable.<locals>.<genexpr>)�any�type�__mro__)�objrrr�callableBsrc@seZdZdd�ZdS)�IteratorcCst|��|�S)N)r�__next__)�selfrrrrJsz
Iterator.nextN)�__name__�
__module__�__qualname__rrrrrrHsrcKst|jf|��S)N)�iter�keys)�d�kwrrr�iterkeysOsrcKst|jf|��S)N)r�values)rrrrr�
itervaluesRsr cKst|jf|��S)N)r�items)rrrrr�	iteritemsUsr"cKst|jf|��S)N)rZlists)rrrrr�	iterlistsXsr#cKs|jf|�S)N)r)rrrrrr[scKs|jf|�S)N)r )rrrrrr ^scKs|jf|�S)N)r")rrrrrr"ascKs|jf|�S)N)r#)rrrrrr#dscCs
|�d�S)Nzlatin-1)�encode)�srrr�bisr&cCs|S)Nr)r%rrr�ulsr'cCs|S)Nr)r%rrrr&rscCst|�dd�d�S)Nz\\z\\\\Zunicode_escape)�unicode�replace)r%rrrr'vs�builtins�execcCs:z*|dkr|�}|j|k	r$|�|��|�Wdd}d}XdS)N)�
__traceback__�with_traceback)�tp�value�tbrrr�reraises

r1cCsB|dkr*t�d�}|j}|dkr&|j}~n|dkr6|}td�dS)zExecute code in a namespace.N�zexec _code_ in _globs_, _locs_)�sys�	_getframe�	f_globals�f_localsr+)Z_code_Z_globs_Z_locs_�framerrr�exec_�s
r8zedef reraise(tp, value, tb=None):
    try:
        raise tp, value, tb
    finally:
        tb = None
)rrz�def raise_from(value, from_value):
    try:
        if from_value is None:
            raise value
        raise value from from_value
    finally:
        value = None
zrdef raise_from(value, from_value):
    try:
        raise value from from_value
    finally:
        value = None
cCs|�dS)Nr)r/Z
from_valuerrr�
raise_from�sr9)�	HTTPError)�client)�Queue)�quote)�parsecCs2t|dt|dd��}|dkr.tdt|�j��|S)N�__code__�	func_codezCould not get code from %r)�getattr�	TypeErrorrr)�func�rvrrr�get_code�srEcCsfyddlm}Wntk
r$dSXd|kr2dSt|�dd����dkrbddlm}|td��dS)	Nr)�opt�threadszenable-threads�0)�false�off�norH)�warnz�We detected the use of uwsgi with disabled threads.  This will cause issues with the transport you are trying to use.  Please enable threading for uwsgi.  (Enable the "enable-threads" flag).)	ZuwsgirF�ImportError�str�get�lower�warningsrL�Warning)rFrLrrr�
check_threads�srS)N)NN)<�__doc__�
__future__r�operatorr3�types�version_info�PY2�PY3rN�string_types�intZ
integer_typesrZclass_typesZ	text_type�bytesZbinary_type�
basestring�longZ	ClassTyper(rr	�	NameErrorr�objectrrr r"r#r&r'�io�StringIO�BytesIOrA�
__import__r8r1r9Zurllib.errorr:�httpr;�httplibZurllib.requestZrequest�urllib2�queuer<�urllib.parser=Zurllib_quote�urllibr>�urlparserErSrrrr�<module>	s�