Edit File: warnings.cpython-36.opt-1.pyc
3 � \8H��������������� ���@���s��d�Z�ddlZddddddd d gZd;dd�Zd<dd�Zd d��Zdd��ZeZdd��ZeZ dd��Z dedddfdd�Zeddfdd�Z dd��Zdd ��ZG�dd��de�Zdd��Zd d!��Zd"d#��Zd$d%��Zd&d'��Zd(d)��Zd=d+d�Zd>d,d�ZG�d-d.��d.e�ZG�d/d ��d e�ZdZy0dd0lmZm Z m!Z!mZmZm"Z"�e Z#e!Z$d1ZW�n.�e%k �rf���g�Zd2Z#i�Z$d*a&d3d4��Z"Y�nX�eej'��e�s�e(e)gZ*e*j+e,��xe*D�]Z-e d5e-d6���q�W�ej.j/Z/e/d*k�r�d7Z0ne/�r�d2Z0nd5Z0e e0e1d*d8��e2ed9��r�d:Z3nd5Z3e e3e4d*d8��[dS�)?z&Python part of the warnings subsystem.�����N�warn� warn_explicit�showwarning� formatwarning�filterwarnings�simplefilter� resetwarnings�catch_warningsc�������������C���s���t�|�|||||�}t|��dS�)z7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg��r���� /usr/lib64/python3.6/warnings.pyr��� ���s����c�������������C���s���t�|�|||d|�}t|�S�)z.Function to format a warning the standard way.N)r ����_formatwarnmsg_impl)r���r ���r���r���r���r���r���r���r���r������s����c�������������C���sP���|�j�}|d�kr tj}|d�kr d�S�t|��}y|j|��W�n�tk rJ���Y�nX�d�S�)N)r����sys�stderr�_formatwarnmsg�write�OSError)r���r����textr���r���r���r������s����r���c�������������C���sL��d|�j�|�j|�jj|�jf�}|�jd�kr`ydd�l}|j|�j�|�j�}W�qf�tk r\���d�}d�}Y�qfX�n|�j}|r~|j ��}|d|�7�}|�j d�k �rHydd�l}|j|�j �}W�n�tk r����d�}Y�nX�|d�k �rH|d7�}xx|D�]p}|d|j�|jf�7�}y$|d�k �r |j|j�|j�}nd�}W�n�tk �r*���d�}Y�nX�|r�|j ��}|d|�7�}q�W�|S�)Nz%s:%s: %s: %s r���z %s z.Object allocated at (most recent call first): z File "%s", lineno %s z %s ) r���r���r ����__name__r���r���� linecache�getline� Exception�strip�source�tracemalloc�get_object_traceback)r����sr���r���r"����tb�framer���r���r���r���#���sF���� r���c�������������C���sd���yt�}W�n�tk r���Y�n<X�|tk rXt|�s6td��||�j|�j|�j|�j|�j |�j ��dS�t|���dS�)z7Hook to write a warning to a file; replace if you like.z:warnings.showwarning() must be set to a function or methodN)r���� NameError�_showwarning_orig�callable� TypeErrorr���r ���r���r���r���r���r���)r����swr���r���r����_showwarnmsgU���s����r,���c�������������C���sJ���yt�}W�n�tk r���Y�n&X�|tk rB||�j|�j|�j|�j|�jd�S�t|��S�)z.Function to format a warning the standard way.)r���) r���r'����_formatwarning_origr���r ���r���r���r���r���)r����fwr���r���r���r���j���s���� r�����Fc�������������C���s0���ddl�}t|�|j||j�||j|�||d��dS�)a���Insert an entry into the list of warnings filters (at the front). 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'message' -- a regex that the warning message must match 'category' -- a class that the warning must be a subclass of 'module' -- a regex that the module name must match 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters r���N)�append)�re�_add_filter�compile�I)�actionr���r ����moduler���r0���r1���r���r���r���r���w���s���� c�������������C���s���t�|�d|d||d��dS�)a���Insert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'category' -- a class that the warning must be a subclass of 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters N)r0���)r2���)r5���r ���r���r0���r���r���r���r�������s����c�������������G���sR���|�s6yt�j|��W�n�tk r&���Y�nX�t�jd|��n|t�krHt�j|��t���d�S�)Nr���)�filters�remove� ValueError�insertr0����_filters_mutated)r0����itemr���r���r���r2�������s���� r2���c���������������C���s���g�t�dd�<�t���dS�)zAClear the list of warning filters, so that no filters are active.N)r7���r;���r���r���r���r���r�������s����c���������������@���s���e�Zd�ZdZdS�)�_OptionErrorz,Exception used by option processing helpers.N)r���� __module__�__qualname__�__doc__r���r���r���r���r=�������s���r=���c�������������C���sR���xL|�D�]D}yt�|��W�q�tk rH�}�ztd|tjd��W�Y�d�d�}~X�qX�qW�d�S�)NzInvalid -W option ignored:)r���)� _setoptionr=����printr���r���)�args�argr���r���r���r����_processoptions����s ���� rE���c�������������C���s����dd�l�}|�jd�}t|�dkr,td|�f���xt|�dk�rF|jd��q.W�dd��|D��\}}}}}t|�}|j|�}t|�}|j|�}|r�|d�}|r�yt|�}|dk�r�t �W�q��t t fk r����td |f���Y�q�X�nd}t|||||��d�S�) Nr����:����ztoo many fields (max 5): %rr/���c�������������S���s���g�|�]}|j����qS�r���)r ���)�.0r$���r���r���r���� <listcomp>����s���z_setoption.<locals>.<listcomp>�$zinvalid lineno %r)r1����split�lenr=���r0���� _getaction�escape�_getcategory�intr9���� OverflowErrorr���)rD���r1����partsr5���r���r ���r6���r���r���r���r���rA�������s.���� rA���c�������������C���sB���|�sdS�|�dkrdS�xd D�]}|j�|��r|S�qW�td|�f���d�S�) N�default�all�always�ignorer6����once�errorzinvalid action: %r)rS���rU���rV���r6���rW���rX���)� startswithr=���)r5����ar���r���r���rM�������s����� rM���c�������������C���s����dd�l�}|�stS�|jd|��rNyt|��}W�q��tk rJ���td|�f���Y�q�X�n�|�jd�}|�d�|��}|�|d�d���}yt|d�d�|g�}W�n"�tk r����td|f���Y�nX�yt ||�}W�n"�t k r����td|�f���Y�nX�t|t�s�td|�f���|S�)Nr���z^[a-zA-Z0-9_]+$zunknown warning category: %r�.����zinvalid module name: %rzinvalid warning category: %r)r1����Warning�match�evalr'���r=����rfind� __import__�ImportError�getattr�AttributeError� issubclass)r ���r1����cat�ir6����klass�mr���r���r���rO�������s,���� rO���c�������������C���s���|�j�j}d|kod|kS�)zFSignal whether the frame is an internal CPython implementation detail.� importlib� _bootstrap)�f_code�co_filename)r&���r���r���r���r����_is_internal_frame����s����rn���c�������������C���s&���|�j�}�x|�dk r t|��r |�j�}�qW�|�S�)z;Find the next frame that doesn't involve CPython internals.N)�f_backrn���)r&���r���r���r����_next_external_frame��s���� rp���r\���c�������������C���sv��t�|�t�r|�j}|dkrt}t�|t�o.t|t�sDtdjt|�j���yZ|dks\t t jd��rht j|�}n4t jd�}x(t|d��D�]}t |�}|dkr�t�q�W�W�n�tk r����t j}d}Y�nX�|j}|j}d|kr�|d�}nd}|jd�} | �r| j��} | jd��rP| dd��} n>|dk�rFyt jd �} W�n�tk �rD���d} Y�nX�| �sP|} |jd i��}t|�|| |||||��dS�)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r\���r���z<string>�__file__z.pyc�__main__r���Z__warningregistry__���)� isinstancer]���� __class__�UserWarning�typere���r*����formatr���rn���r���� _getframe�rangerp���r9����__dict__� f_globals�f_lineno�get�lower�endswith�argvrd���� setdefaultr���)r���r ���� stacklevelr!���r&����x�globalsr���r6���r���Zfnl�registryr���r���r���r��� ��sL���� c�������������C���s���t�|�}|d�kr8|pd}|dd���j��dkr8|d�d��}|d�krDi�}|jdd�tkrd|j���t|d<�t|�t�r~t|��}|�j}n|�}||��}�|||f} |j| �r�d�S�x^t D�]R} | \}}} }}|d�ks�|j |�r�t|| �r�|d�ks�|j |�r�|dks�||kr�P�q�W�t}|dk�rd|| <�d�S�dd�l }|j||��|dk�r:|��|d k�rnd|| <�||f}tj|��rdd�S�dt|<�nf|d k�rznZ|dk�r�d|| <�||df}|j|��r�d�S�d||<�n$|dk�r�d|| <�ntd || f���t|�||||�}t|��d�S�)Nz <unknown>����z.py�versionr���rV���r\���rX���rW���rU���r6���rS���z1Unrecognized action (%r) in warnings.filters: %s���r����)rP���r���r~����_filters_version�clearrt���r]����strru���r7���r^���re���� defaultactionr����getlines�onceregistry�RuntimeErrorr ���r,���)r���r ���r���r���r6���r�����module_globalsr!���r����keyr<���r5���r���rf����mod�lnr���ZoncekeyZaltkeyr���r���r���r���A��sl���� c���������������@���s"���e�Zd�Zd Zdd d �Zdd��ZdS�)r ���r���r ���r���r���r���r���r!���Nc������� ������C���s:���t���}x|�jD�]} t|�| || ���qW�|r0|jnd�|�_d�S�)N)�locals�_WARNING_DETAILS�setattrr����_category_name) �selfr���r ���r���r���r���r���r!����local_values�attrr���r���r����__init__���s����zWarningMessage.__init__c�������������C���s���d|�j�|�j|�j|�j|�jf�S�)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r���r����r���r���r���)r����r���r���r����__str__���s����zWarningMessage.__str__)r���r ���r���r���r���r���r!���)NNN)r���r>���r?���r����r����r����r���r���r���r���r ������s ����� r ���c���������������@���s8���e�Zd�ZdZddd�dd�Zdd��Zd d ��Zdd��ZdS�) r ���a���A context manager that copies and restores the warnings filter upon exiting the context. The 'record' argument specifies whether warnings should be captured by a custom implementation of warnings.showwarning() and be appended to a list returned by the context manager. Otherwise None is returned by the context manager. The objects appended to the list are arguments whose attributes mirror the arguments to showwarning(). The 'module' argument is to specify an alternative module to the module named 'warnings' and imported under that name. This argument is only useful when testing the warnings module itself. FN)�recordr6���c������������C���s(���||�_�|dkrtjd�n||�_d|�_dS�)z�Specify whether to record warnings and if an alternative module should be used other than sys.modules['warnings']. For compatibility with Python 3.0, please consider all arguments to be keyword-only. N�warningsF)�_recordr����modules�_module�_entered)r����r����r6���r���r���r���r�������s����zcatch_warnings.__init__c�������������C���sP���g�}|�j�r|jd��|�jtjd�k r4|jd|�j���t|��j}d|dj|�f�S�)Nzrecord=Truer����z module=%rz%s(%s)z, )r����r0���r����r���r����rw���r����join)r����rC����namer���r���r����__repr__���s���� zcatch_warnings.__repr__c�������������C���s~���|�j�rtd|����d|�_�|�jj|�_|�jd�d���|�j_|�jj���|�jj|�_|�jj|�_|�j rvg�}|j |�j_|�jj|�j_|S�d�S�d�S�)NzCannot enter %r twiceT)r����r����r����r7����_filtersr;���r����_showwarningr���r����r0���r(���)r�����logr���r���r���� __enter__���s���� zcatch_warnings.__enter__c�������������G���s>���|�j�std|����|�j|�j_|�jj���|�j|�j_|�j|�j_d�S�)Nz%Cannot exit %r without entering first) r����r����r����r����r7���r;���r����r���r���)r�����exc_infor���r���r����__exit__���s���� zcatch_warnings.__exit__)r���r>���r?���r@���r����r����r����r����r���r���r���r���r ������s ��� )r7����_defaultaction� _onceregistryr���r���r;���TrS���c���������������C���s���t�d7�a�d�S�)Nr\���)r����r���r���r���r���r;������s����r;���rV���)r ���rX���)r ���r0����gettotalrefcountrU���)NN)N)Nr\���N)NNNN)5r@���r����__all__r���r���r���r���r(���r,���r-���r���r]���r���r���r2���r���r���r=���rE���rA���rM���rO���rn���rp���r���r����objectr ���r ���Z_warnings_defaults� _warningsr7���r����r����r;���r����r����rb���r�����warnoptions� ImportWarning�PendingDeprecationWarningZsilencer0����DeprecationWarning�cls�flags� bytes_warningZbytes_action�BytesWarning�hasattrZresource_action�ResourceWarningr���r���r���r����<module>���sv��� 0 5� FJ