Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_exceptions.cpython-311.opt-1.pyc
�

�Kev��:�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZddlmZmZddlmZddlmZGd�d	e��ZGd
�de��ZGd�d
e��ZGd�dej��Z dZ!Gd�dej��Z"Gd�dej��Z#Gd�dej��Z$Gd�dej��Z%Gd�dej��Z&Gd�dej��Z'e(dkrej)��dSdS)�N)�dedent)�captured_stderr�check_impl_detail�cpython_only�
gc_collect�
no_tracing�
script_helper�SuppressCrashReport)�
import_module)�TESTFN�unlink)�check_warnings)�supportc��eZdZd�ZdS)�NaiveExceptionc��||_dS�N��x��selfrs  �>/usr/local/apps/python3/lib/python3.11/test/test_exceptions.py�__init__zNaiveException.__init__�
�������N��__name__�
__module__�__qualname__r�rrrrs#����������rrc��eZdZdZd�ZdS)�SlottedNaiveExceptionrc��||_dSrrrs  rrzSlottedNaiveException.__init__rrN)rrr�	__slots__rr rrr"r"s(�������I�����rr"c��eZdZd�ZdS)�BrokenStrExceptionc� �td���)Nzstr() is broken��	Exception�rs r�__str__zBrokenStrException.__str__!s���)�*�*�*rN)rrrr+r rrr&r& s#������+�+�+�+�+rr&c��eZdZd�Zd�Zd�Zd�ZdJd�Zd�Zd	�Z	e
d
���Zd�Ze
jejdkd
��d���Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed���Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,d)�Z-d*�Z.d+�Z/d,�Z0e
j1d-��d.���Z2d/�Z3d0�Z4d1�Z5d2�Z6d3�Z7d4�Z8ed5���Z9e
d6���Z:e
d7���Z;e
d8���Z<d9�Z=e
d:���Z>e
d;���Z?e
d<���Z@e
d=���ZAed>���ZBd?�ZCd@�ZDdA�ZEe
dB���ZFdC�ZGdD�ZHdE�ZIe
jdFdG��dH���ZJdI�ZKdS)K�ExceptionTestsc�|�|�||���5	|d���#|$r}t|��}Yd}~nd}~wwxYw	|d���#|$r}t|��}Yd}~nd}~wwxYw|�||��|�|j|��ddd��dS#1swxYwYdS)N)�exc�excname�spam)�subTest�str�assertEqualr)rr/r0�err�buf1�buf2s      r�raise_catchzExceptionTests.raise_catch(s8��
�\�\�c�7�\�
3�
3�
	4�
	4�
 ��c�&�k�k�!���
 �
 �
 ��3�x�x�����������
 ����
 ��c�&�k�k�!���
 �
 �
 ��3�x�x�����������
 �������T�4�(�(�(����S�\�7�3�3�3�
	4�
	4�
	4�
	4�
	4�
	4�
	4�
	4�
	4�
	4�
	4�
	4����
	4�
	4�
	4�
	4�
	4�
	4sR�B1�%�A�>�B1�A�B1�A�A0�A+�&B1�+A0�04B1�1B5�8B5c�

�|�td��|�tttd��|�t
d��t
tdd���}|���t
tdd���}tj	}		ddl
}|�d	��n#t
$rYnwxYw|t_	|���tt��n9#|t_	|���tt��wxYw|�td
��|�ttdd��|�td��|�ttd
��|�t d��g}|�t |jd��|�t$d��i}|�t$|jd��|�t&d��|�t(d��|�t*d��t,}n#t*$rYnwxYw|�t.d��d}t1d��D]}||z
}�|�t2d��|�t4d��|�t6d��t9d��n#t6$rYnwxYw|�t:d��|�t<d��t?ddd ��|� d!��n#t<$rYnwxYw|�tBd"��|�tDd#��|�tDtj#d��|�tHd$��gd%zn#tH$rYnwxYw|�tJd&��|�tJtLd'��|�tNd(��ddz}n#tN$rYnwxYw|�tPd)��ddz}n#tP$r
}Yd}~nd}~wwxYw|�tRd*��dS)+N�AttributeError�undefined_attribute�EOFError�w�utf-8��encoding�rrr�OSErrorzthis file does not exist�ImportError�undefined_module�
IndexError�
�KeyError�key�KeyboardInterrupt�MemoryError�	NameError�
OverflowError���RuntimeError�RecursionError�SyntaxErrorz/
�IndentationError�TabErrorz"try:
	1/0
    	1/0
finally:
 pass
z<string>�execzTabError not raised�SystemError�
SystemExit�	TypeErrorr �
ValueErrori�ZeroDivisionErrorr)�StopAsyncIteration)*r8r:�assertRaises�getattr�sysr<�openr�close�stdin�marshal�loadsr
rBrC�
__import__rE�__getitem__rGrIrJrK�undefined_variablerL�rangerOrPrQrTrRrS�compile�failrUrV�exitrWrX�chrrYr)rZ)r�fp�	savestdinrar�dummy�es       r�testRaisingzExceptionTests.testRaising5s�������)9�:�:�:����.�'�3�8M�N�N�N�����:�.�.�.�
�&�#��
0�
0�
0��
���
�
�
�
�&�#��
0�
0�
0���I�	�		�
������
�
�c�"�"�"�"���
�
�
���
����"�C�I��H�H�J�J�J��6�N�N�N�N��"�C�I��H�H�J�J�J��6�N�N�N�N��������)�,�,�,����'�4�)C�S�I�I�I�����m�4�4�4����+�z�3E�F�F�F�����\�2�2�2������*�a�m�R�8�8�8�����:�.�.�.������(�A�M�5�9�9�9����*�,?�@�@�@�����m�4�4�4�����K�0�0�0�#�Q�Q������$�$����������8�8�8�
���3�Z�Z�	�	�E�
��F�A�A�����~�6�6�6�����)9�:�:�:�����m�4�4�4�
�%�[�[�[�[��� � � �D�D� �������)�+=�>�>�>�����:�.�.�.�
�@���)�)�)��i�i�-�.�.�.�.������������	
����m�4�4�4�����\�2�2�2����*�c�h��2�2�2�����K�0�0�0�
�"�W�W�W������$�$���������\�2�2�2����*�c�6�2�2�2����*�,?�@�@�@��1��Q�Q�� �&�&�&�$�$�&��������K�0�0�0��1��Q�Q���#�#�#�t�t�t�t�t�����#�������+�-A�B�B�B�B�Bs��.C�D
�
C�D
�C�D
�
6E�J�
J!� J!�)L9�9
M�M�?N&�&
N3�2N3�-P3�3
Q�?Q�R � 
R-�,R-�S�
S%� S%c�F���fd�}d}||d��|dd��dS)Nc�<����||���5	t|dd����d��nB#t$r5}|j|kr ��d|�d|j����Yd}~nd}~wwxYwddd��dS#1swxYwYdS)N)�src�msg�
<fragment>rT�"failed to get expected SyntaxError�	expected �, got )r2rgrhrQrs)rrrsrnrs   �r�ckmsgz4ExceptionTests.testSyntaxErrorMessage.<locals>.ckmsg�s������#�3��/�/�
D�
D�D��C��v�6�6�6�
�I�I�B�C�C�C�C��	#�H�H�H��u��|�|��	�	�	�3�3�3����"F�G�G�G����������H����
D�
D�
D�
D�
D�
D�
D�
D�
D�
D�
D�
D����
D�
D�
D�
D�
D�
Ds9�B�A�B�
B�+A<�7B�<B�B�B�BzHif 1:
        try:
            continue
        except:
            passz'continue' not properly in loopz	continue
r �rrx�ss`  r�testSyntaxErrorMessagez%ExceptionTests.testSyntaxErrorMessage�sV���	D�	D�	D�	D�	D�
��	��a�2�3�3�3�
��l�=�>�>�>�>�>rc�4��tf�fd�	}d}||d��d}||d��d}||d��d}||d��d}||d��d	}||d
��d}||d
��d}||d
t��d}||dt��dS)Nc����	t|dd����d��dS#|$r<}|j|kr&��d|�d|j����Yd}~dSYd}~dSd}~wwxYw)NrtrTrurvrw)rgrhrs)rrrs�	exceptionrnrs    �rrxz:ExceptionTests.testSyntaxErrorMissingParens.<locals>.ckmsg�s����
@���\�6�2�2�2�
�	�	�>�?�?�?�?�?��	�
D�
D�
D��5�C�<�<��I�I�I�s�s�s�A�E�E�B�C�C�C�C�C�C�C�C�C� �<�<�<�<�<�����
D���s�+�A,�+A'�'A,zprint "old style"z@Missing parentheses in call to 'print'. Did you mean print(...)?zprint "old style",zprint f(a+b,c)zexec "old style"z>Missing parentheses in call to 'exec'. Did you mean exec(...)?z
exec f(a+b,c)zprint (a+b,c) $ 42zinvalid syntaxzexec (a+b,c) $ 42zif True:
print "No indent"z9expected an indented block after 'if' statement on line 1z6if True:
        print()
	exec "mixed tabs and spaces"z2inconsistent use of tabs and spaces in indentation)rQrRrSrys`  r�testSyntaxErrorMissingParensz+ExceptionTests.testSyntaxErrorMissingParens�s���&1�	@�	@�	@�	@�	@�	@�
$��
��a�S�T�T�T�$��
��a�S�T�T�T���
��a�S�T�T�T�"��
��a�Q�R�R�R���
��a�Q�R�R�R�

!��
��a�!�"�"�"���
��a�!�"�"�"�
.��
��a�L�N^�_�_�_�K��
��a�E�x�P�P�P�P�PrNr>c���|�|||���5|�t��5}t|dd��ddd��n#1swxYwY|�|jj|��|�|jj|��|� |�|jj|��|� |�|jj	|��|jj
�it|t��s|�
|d��}|�d��|dz
}|�||jj
��ddd��dS#1swxYwYdS)N)�source�lineno�offsetrtrT�replace�
rM)r2r[rQrgr4r~r�r��
end_lineno�
end_offset�text�
isinstancer3�decode�split�assertIn)	rrrr�r�r�r�r@�cm�lines	         r�checkzExceptionTests.check�s���
�\�\��V�F�\�
C�
C�	7�	7��"�"�;�/�/�
3�2���\�6�2�2�2�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3�
3����
3�
3�
3�
3����R�\�0�&�9�9�9����R�\�0�&�9�9�9��%�� � ���!8�*�E�E�E��%�� � ���!8�*�E�E�E��|� �,�!�#�s�+�+�:��*�*�X�y�9�9�C��y�y����v�a�x�0���
�
�d�B�L�$5�6�6�6�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7�	7�	7s5�E#�A�E#�A	�E#�A	�C<E#�#E'�*E'c�.�|j}|ddd��dS)Nz"\
"(1 for c in I,\
\��r��rr�s  r�)test_error_offset_continuation_charactersz8ExceptionTests.test_error_offset_continuation_characters�s$���
��
��*�A�q�1�1�1�1�1rc�x�|j}|ddd��|ddd��|ddd��|d	dd
��|ddd
��|ddd
d���|ddd��|ddd��|ddd��|ddd��|ddd��|ddd��|ddd��|ddd��|ddd��|ddd
��|ddd��|ddd ��|d!dddd"��|d#dddd
��|d$dd%dd��|d&dd%dd��|d'dd��|d(dd��|d)dd��|d*dd��|d+dd,��|d-dd,��|d.dd��|d/dd%��|d0dd��|d1dd,��|d2dd ��|d3dd%��|d4dd%��|d5dd%d6���|d7dd8��|d9dd��|d:dd��|d;dd��|d<d=d>��|d?dd@��|dAdd@��|dBddC��|dDdd ��|dEdd@��|dFdd��|dGddH��|dIdd��|dJdd��|dKdd��|dLdd��|dMdd��|dNdd��|dOdd��|dPdd��|dQdd��|dRdd��|dSdd��|dTdd��|dUdd��|dVdd ��dS)WNzdef fact(x):
	return x!
r�rFz1 +
rM�z def spam():
  print(1)
 print(2)�zPython = "Python" +�uPython = "Ṕýţĥòñ" +s+# -*- coding: cp1251 -*-
Python = "ϳ���" +��cp1251r?sPython = "ϳ���" +�zx = "a�zlambda x: x = 2zf{a + b + c}zile for str(file) in []
]�ua = « hello » « world »z[
file
for str(file)
in
[]
]zile for
 str(file) in []]zages = {'Alice'=22, 'Bob'=23}�	z7match ...:
    case {**rest, "key": value}:
        ...z
[a b c d e f]zfor x yfff:�zf(a for a in b, c)�zf(a for a in b if a, c)zf(a, b for b in c)�zf(a, b for b in c, d)zclass foo:return 1zdef f():
  continuezdef f():
  breakz4try:
  pass
except:
  pass
except ValueError:
  passztry:
  pass
except*:
  pass�z6try:
  pass
except*:
  pass
except* ValueError:
  passz(0x+1)zx = 0xIz0010 + 2z
x = 32e-+4zx = 0o9uα = 0xIsα = 0xIs## -*- coding: iso8859-7 -*-
� = 0xIz	iso8859-7s�if 1:
            def foo():
                '''

            def bar():
                pass

            def baz():
                '''quux'''
            �z"pass
pass
pass
(1+)
pass
pass
passz(1+)z[interesting
foo()
s#coding: utf8
print('我')
r���z7f'''
            {
            (123_a)
            }'''�ztf'''
            {
            f"""
            {
            (123_a)
            }
            """
            }'''z4f"""


            {
            6
            0="""�
z!x = [(yield i) for i in range(3)]zdef f():
  from _ import *zdef f(x, x):
  passz3{i for i in range(5) if (j := 0) for j in range(5)}�&zdef f(x):
  nonlocal xzdef f(x):
  x = 1
  global xz
nonlocal xz def f():
  global x
  nonlocal xz#from __future__ import doesnt_existzfrom __future__ import bracesz#x=1
from __future__ import divisionzfoo(1=2)zdef f():
  x, y: intz[*x for x in xs]zfoo(x for x in range(10), 100)zfor 1 in []: passz
(yield i) = 2zdef f(*):
  passr�r�s  r�testSyntaxErrorOffsetz$ExceptionTests.testSyntaxErrorOffset�s}���
��
��+�Q��3�3�3�
��g�q�!����
��2�A�r�:�:�:�
��#�Q��+�+�+�
��;�Q��C�C�C�
��L���h�	(�	(�	(�	(�
��2�A�r�:�:�:�
��h��1����
����A�&�&�&�
��n�a��#�#�#�
��,�a��4�4�4�
��+�Q��2�2�2�
��1�1�a�8�8�8�
��,�a��3�3�3�
��-�q�!�4�4�4�
��I�1�b�Q�Q�Q�
��o�q�!�$�$�$�
��m�Q��"�"�"�
��"�A�q�!�R�0�0�0�
��'��A�q�"�5�5�5�
��"�A�q�!�R�0�0�0�
��%�q�!�Q��3�3�3�	��"�A�r�*�*�*�
��$�a��+�+�+�
��!�1�a�(�(�(�
��I�1�a�P�P�P�
��.��1�5�5�5�
��K�Q�PQ�R�R�R�	��h��1����
��i��A����
��j�!�Q����
��l�A�q�!�!�!�
��i��A����
��n�a��#�#�#�
����A�&�&�&�
��8�!�Q�"�	$�	$�	$�	$�
��	��B�		�		�		�	��8�!�Q�?�?�?�
��f�a�����
��%�q�!�,�,�,�
��C�Q��K�K�K�
�����	�	�	�	�����	�	�	�	���
��	�	�	�	��1�1�a�8�8�8�
��+�Q��3�3�3�
��$�a��,�,�,�
��C�Q��K�K�K�
��'��A�.�.�.�
��.��1�5�5�5�
��l�A�q�!�!�!�
��2�A�q�9�9�9�	��3�Q��:�:�:�
��-�q�!�4�4�4�
��4�a��;�;�;�
��j�!�Q����
��%�q�!�,�,�,�
�� �!�Q�'�'�'�
��.��1�5�5�5�
��!�1�a�(�(�(�
��o�q�!�$�$�$�
��!�1�a�(�(�(�(�(rc������Gd�dt���Gd�d�����fd�}��fd�}��fd�}tj�d��s |��|��|��dSdS)	Nc��eZdZd�ZdS)�9ExceptionTests.testSettingException.<locals>.BadExceptionc� �td���)Nzcan't instantiate BadException)rO)�self_s rrzBExceptionTests.testSettingException.<locals>.BadException.__init__Gs��"�#C�D�D�DrNrr rr�BadExceptionr�Fs(������
E�
E�
E�
E�
Err�c��eZdZdS)�=ExceptionTests.testSettingException.<locals>.InvalidExceptionN�rrrr rr�InvalidExceptionr�J��������Drr�c�n��ddl}	|��d����d��dS#t$rv}t	j��\}}}|jj}��|j	d����
|j�d����Yd}~dSd}~wwxYw)NrrM�Expected exception�
test_capi1�test_exceptions.py)
�	_testcapi�raise_exceptionrhrWr]�exc_info�tb_frame�f_coder4�co_name�
assertTrue�co_filename�endswith)r�r5r/�tb�cor�rs     ��rr�z7ExceptionTests.testSettingException.<locals>.test_capi1Ms��������
0��)�)�,��:�:�:��	�	�.�/�/�/�/�/��
�
O�
O�
O�"�|�~�~���S�"��[�'��� � ���\�:�:�:������ 7� 7�8L� M� M�N�N�N�N�N�N�N�N�N�����	
O���s�4�
B4�A+B/�/B4c����ddl}	|��d����d��dS#t$r�}t	j��\}}}|jj}��|j	d����
|j�d����|jj
j}��|j	d��Yd}~dSd}~wwxYw)Nrr�rr��
test_capi2)r�r�rhrOr]r�r�r�r4r�r�r�r��f_back)r�r5r/r�r��co2r�rs      ��rr�z7ExceptionTests.testSettingException.<locals>.test_capi2Ys��������

0��)�)�,��:�:�:��	�	�.�/�/�/�/�/�� �
<�
<�
<�"�|�~�~���S�"��[�'��� � ���Z�8�8�8������ 7� 7�8L� M� M�N�N�N��k�(�/��� � ���l�;�;�;�;�;�;�;�;�;�����

<���s�4�
C �BC�C c�T��ddl}��t|j�d��dS)NrrM)r�r[rUr�)r�r�rs ��r�
test_capi3z7ExceptionTests.testSettingException.<locals>.test_capi3gs=����������k�9�+D�.��
3�
3�
3�
3�
3r�java)r)r]�platform�
startswith)rr�r�r�r�r�s`   @@r�testSettingExceptionz#ExceptionTests.testSettingExceptionAs�����
	E�	E�	E�	E�	E�9�	E�	E�	E�	�	�	�	�	�	�	�	�
	0�
	0�
	0�
	0�
	0�
	0�	0�	0�	0�	0�	0�	0�	3�	3�	3�	3�	3�	3�
�|�&�&�v�.�.�	��J�L�L�L��J�L�L�L��J�L�L�L�L�L�	�	rc�,�	t|�tt��|�t	td����d��|�t	tdd����d��tddd��}|�|jd��|�|jd��|�t	|��d��td	ddd
��}|�|jd��|�|jd
��|�|jd��|�|jd��|�|j	d��|�t	|��d��td	ddd��}|�|jd
��|�|jd��|�|jd��|�|jd��|�|j	d��|�t	|��d��tdd��}|�|jd��|�|jd��|�|jd��|�|jd��|�|j	d��dS#t$rYdSwxYw)Ni��1001�messagez[Errno 1001] messager��foo�barz[Errno 9] foo: 'bar'rr�r�z[WinError 3] foo: 'bar'�z[WinError 1001] foo)�WindowsError�assertIsrBr4r3�errno�winerror�strerror�filename�	filename2rK)rr=s  r�test_WindowsErrorz ExceptionTests.test_WindowsErrorqs���$	0��L�
�M�M�,��0�0�0����S�����/�/��8�8�8����S���y�!9�!9�:�:�3�
5�
5�
5���5�%�(�(�A����Q�W�a�(�(�(����Q�Z��.�.�.����S��V�V�%;�<�<�<���5�%��+�+�A����Q�W�a�(�(�(����Q�Z��+�+�+����Q�Z��/�/�/����Q�Z��/�/�/����Q�[�$�/�/�/����S��V�V�%>�?�?�?���5�$��-�-�A����Q�W�b�)�)�)����Q�Z��.�.�.����Q�Z��/�/�/����Q�Z��.�.�.����Q�[�$�/�/�/����S��V�V�%:�;�;�;���u�%�%�A����Q�W�e�,�,�,����Q�Z��.�.�.����Q�Z��/�/�/����Q�Z��.�.�.����Q�[�$�/�/�/�/�/��E�	�	�	��D�D�	���s�L�
L�L�win32ztest specific to Windowsc���td��}d}|�td|z��5|j�|��ddd��dS#1swxYwYdS)z:Should fill in unknown error code in Windows error message�ctypeslcs�@zWindows Error 0x%xN)r�assertRaisesRegexrB�	pythonapi�PyErr_SetFromWindowsErr)rr��codes   r�test_windows_messagez#ExceptionTests.test_windows_message�s����x�(�(����
�
#�
#�G�-A�D�-H�
I�
I�	;�	;���4�4�T�:�:�:�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;����	;�	;�	;�	;�	;�	;s�A�A�Ac�^�tdddiftdddiftdddiftdddiftdddd�ftddddddd�ftd	d	dddd
d�ftdd	dddd
d�ftd
d	ddd�ftdddddd�ftddddddd�ftddddddddd�ftdddddddddd�ftddd ddddd!d"d#d$�	ftd%dd%dddddddd&�	ftdddift
d'd'd(d)d*d+d,�ftd(td-��d*dd+fd(td-��d*dd+fd(d-d*d+d,�ftd.d.d(d-d*d+d,�ftd/d/d0d1d*dd2�ftdddd3�ftdddd3�fg}	|�tdddddddd4�f��n#t$rYnwxYw|D�]�\}}}	||�}t|��j�d5��s(|�t|��jd6��t'|��}|D]Z}t)||��}|�t+|��t+||��|�d7|�d8|�d9||�����[t,fD]�}	t/|	jdz��D]�}
|	�||
��}|	�|��}|D]Q}t+t)||����}t+||��}
|�||
d:|�d;|�����R������n#t7d<|�d=|��t8j�>��Y���xYwdS)?Nr �args)rM)r�)r�rMr�)r�r�)r�r�r�r�r�)r�r�r�)r�r��bazr�)r�r�r�N�quuxr�)r�r�r�)�errnoStr�strErrorStr�filenameStr)r�r�r�r�r�)r�r�r�r�)rMr�r�)rMr�rM)r�r�r�r�r�)rsr�r�r�r�r��print_file_and_line)�msgStrr�)r�r�r�rsr�r�r�r�)r�)r��	linenoStr�	offsetStr�textStr�endLinenoStr�endOffsetStrr�r�r�r�r�)	r�r�r�r�rsr�r�r�r�)r�r�r�r�r�r�r��print_file_and_lineStr)	r�r�r�rsr�r�r�r�r�)�ascii�arrM�ordinal not in ranger�r�rr�)r�r@�object�start�reason��)r�r�rrMr�)�あrrM�ouchr�r�)r�r�r�r��end)r�r)r�r�r�r�r�r�r�builtins�.z == z, expected z	pickled "z", attribute "z
exc=z, args=)�file)�
BaseExceptionrVrBrQ�UnicodeError�UnicodeEncodeError�UnicodeDecodeError�	bytearray�UnicodeTranslateErrorrr"�appendr�rK�typerr�r4rr3r\�repr�picklerf�HIGHEST_PROTOCOL�dumpsrb�printr]�stderr)r�
exceptionListr/r��expectedrnrz�checkArgName�value�p�protocol�new�got�wants              r�testAttributeszExceptionTests.testAttributes�st���B��"�
�.�
�E�F�T�?�3�
�H��(�#�
%�
�J��*�%�
'�
��"�U�3�3�
5�
�h�"��T��d�4�4�
5��n�(�"�$� �u�6�6�
7��+�(�#�4� �u�6�6�
7��9�(�u�6�R�R�
T�
�@�5�+�z�+�-�-�
.��7�,��+�+�4�A�A�
B��"�t�d�!�d�t�"�D�B�B�
C��+�%��)-�x�"�t��#�%�%�
&�
�G�'�)�G�*.�x�+��-�^�
M�M�
N��5��5�*.�x�"�t��#�4�
9�9�	
:��2���~�.�
�":�C�%�#��)?�A�A�
B� �'�9�W�+=�+=�q�!�"8�":�"�I�g�$6�$6��1�+A�C�%�'��)?�A�A�
B� �":�C�%�'��)?�A�A�
B�#�$<�2�$���a�)�)�
*��X�!��.�.�
0�
"�H�!��.�.�
0�eT
�
�j
	�� � ��@�0�"/�d� �"/�t�E�E�F�
�
�
�
���	�	�	��D�	����$1�	@�	@��C��x�
@��C��J���A�w�w�'�0�0�1A�B�B�E��$�$�T�!�W�W�%7��D�D�D���F�F��$,�E�E�L�#�A�|�4�4�E��$�$�T�%�[�[�%)�(�<�*@�%A�%A�%&�Q�Q����%*�U�U�H�\�,B�,B�&D�E�E�E�E�!��	@�	@�A�$)�!�*<�q�*@�$A�$A�@�@���G�G�A�x�0�0���g�g�a�j�j��,4�@�@�L�"&�w�s�L�'A�'A�"B�"B�C�#'���(>�#?�#?�D� �,�,�S�$�$�./�a�a���.?�@�@�@�@�@�@�	@��%
J���S�S�S�$�$�7�c�j�I�I�I�I�I�I����		@�	@s�$F�
F�F�L�#L*c�J�td��td��td��fD�]�}|�|���5|�t|d����|�d��|�|jdg��|�	t��5|�d��ddd��n#1swxYwY|�|jdg��|�d��|�|jddg��|`|�t|d����|�d	��|�|jd	g��d|_|�|jd��|�	t��5|�d
��ddd��n#1swxYwY|�|jd��ddd��n#1swxYwY���dS)NrMr�r��rn�	__notes__zMy Note�*z	Your NotezOur Notez
will not work)r�r)rXr2�assertFalse�hasattr�add_noter4rr[rW�rrns  r�
test_noteszExceptionTests.test_notes&s�����"�"�I�a�L�L�*�Q�-�-�@�	2�	2�A������"�"�
2�
2�� � ���K�!8�!8�9�9�9��
�
�9�%�%�%�� � ���y�k�:�:�:��&�&�y�1�1�#�#��J�J�r�N�N�N�#�#�#�#�#�#�#�#�#�#�#����#�#�#�#�� � ���y�k�:�:�:��
�
�;�'�'�'�� � ���y�+�.F�G�G�G��K�� � ���K�!8�!8�9�9�9��
�
�:�&�&�&�� � ���z�l�;�;�;� ���� � ���b�1�1�1��&�&�y�1�1�0�0��J�J��/�/�/�0�0�0�0�0�0�0�0�0�0�0����0�0�0�0�� � ���b�1�1�1�/
2�
2�
2�
2�
2�
2�
2�
2�
2�
2�
2����
2�
2�
2�
2��	2�	2s\�A/H�5C�H�C�H�C�C#H�G$�H�$G(�(H�+G(�,H�H	�H	c��	td���#tj��d}YnxYwt���|��}|�|t��|�|j|��td���|��}|�|t��|�|j|��Gd�dt��}|���|��}|�||��|�|j|��dS)Nr�r�r�c��eZdZdS)�5ExceptionTests.testWithTraceback.<locals>.MyExceptionNr�r rr�MyExceptionr"Or�rr#)	rEr]r�r��with_traceback�assertIsInstancer4�
__traceback__r))rr�rnr#s    r�testWithTracebackz ExceptionTests.testWithTracebackAs5��	#��Q�-�-���	#������"�B�B�B�����O�O�*�*�2�.�.�����a��/�/�/������"�-�-�-��q�M�M�(�(��,�,�����a��,�,�,������"�-�-�-�	�	�	�	�	�)�	�	�	�
�K�M�M�(�(��,�,�����a��-�-�-������"�-�-�-�-�-���.c���	dt��_|�d��dS#t$r.}|�dt|����Yd}~dSd}~wwxYw)Nr��No exception raisedz!__traceback__ must be a traceback)r)r&rhrWr�r3rs  r�testInvalidTracebackz#ExceptionTests.testInvalidTracebackVs���	-�()�I�K�K�%�
�I�I�+�,�,�,�,�,���	G�	G�	G��M�M�=�s�1�v�v�F�F�F�F�F�F�F�F�F�����	G���s�,�
A$�#A�A$c�z�|�ttt��dd��|�ttt��d��|�ttt��dd��|�ttt��d��dS)N�	__cause__rM�__context__)r[rW�setattrr)�delattrr*s r�testInvalidAttrszExceptionTests.testInvalidAttrs^s������)�W�i�k�k�;��J�J�J����)�W�i�k�k�;�G�G�G����)�W�i�k�k�=�!�L�L�L����)�W�i�k�k�=�I�I�I�I�Irc���	td���#tj��d}YnxYwt��}||_d|_|�|jd��dS)Nr�r�)rEr]r�r)r&r4)rr�rns   r�testNoneClearsTracebackAttrz*ExceptionTests.testNoneClearsTracebackAttrdse��	#��Q�-�-���	#������"�B�B�B�����K�K�������������$�/�/�/�/�/r(c��t��}|�|j��|�|j��t	��}|�|j��|�|j��Gd�dt
��}|��}|�|j��|�|j��dS)Nc��eZdZdS)�5ExceptionTests.testChainingAttrs.<locals>.MyExceptionNr�r rrr#r6xr�rr#)r)�assertIsNoner.r-rWrB)rrnr#s   r�testChainingAttrsz ExceptionTests.testChainingAttrsos����K�K�����!�-�(�(�(����!�+�&�&�&��K�K�����!�-�(�(�(����!�+�&�&�&�	�	�	�	�	�'�	�	�	�
�K�M�M�����!�-�(�(�(����!�+�&�&�&�&�&rc��	t���#t$r}|}Yd}~nd}~wwxYw|�|j��|�|j��|�|j��t
��|_d|_|�|jt��|�|j��|�|j��d|_|�|j��dS)NF)	r)r7r.r-r�__suppress_context__rKr%r�)rr/rns   r�testChainingDescriptorsz&ExceptionTests.testChainingDescriptorss���	��+�+����	�	�	��A�A�A�A�A�A�����	����	
���!�-�(�(�(����!�+�&�&�&�����/�0�0�0�!����
�������a�m�Y�7�7�7����!�+�&�&�&�����.�/�/�/�!&�������/�0�0�0�0�0s��
&�!�&c��|�ttd���Gd�dt��}|d���}|�|jd��dS)NrM)r�c��eZdZd�ZdS)�8ExceptionTests.testKeywordArgs.<locals>.DerivedExceptionc�H�t�|��||_dSr)r�r�	fancy_arg)rr@s  rrzAExceptionTests.testKeywordArgs.<locals>.DerivedException.__init__�s!���&�&�t�,�,�,�!*����rNrr rr�DerivedExceptionr>�s#������
+�
+�
+�
+�
+rrAr)r@)r[rWr�r4r@)rrArs   r�testKeywordArgszExceptionTests.testKeywordArgs�s|��	
���)�]�a��8�8�8�	+�	+�	+�	+�	+�}�	+�	+�	+�

��r�*�*�*�������b�)�)�)�)�)rc�����fd��|�t����fd��|�t���dS)Nc������Srr )�fs�rrEz/ExceptionTests.testInfiniteRecursion.<locals>.f�s����1�3�3�Jrc�<��	���S#t$rYdSwxYw)Nr��rX��gs�rrIz/ExceptionTests.testInfiniteRecursion.<locals>.g�s5���
��q�s�s�
���
�
�
��r�r�
���s�	
�
�)r[rP)rrErIs @@r�testInfiniteRecursionz$ExceptionTests.testInfiniteRecursion�sj����	�	�	�	�	����.�!�,�,�,�	�	�	�	�	�
	
���.�!�,�,�,�,�,rc��|�tt����|�ttd������|�ttdd������dS)Nr��b)r�r3r)r*s r�test_strzExceptionTests.test_str�sd������I���'�'�'�����I�c�N�N�+�+�,�,�,�����I�c�3�/�/�0�0�1�1�1�1�1rc�6�	t���#t$r%}|�|t��Yd}~nd}~wwxYw|�dt����|�t
��5|ddd��dS#1swxYwYdS�Nrn�r)r%�assertNotIn�localsr[�UnboundLocalErrorrs  r�test_exception_cleanup_namesz+ExceptionTests.test_exception_cleanup_names�s���	0��+�+����	0�	0�	0��!�!�!�Y�/�/�/�/�/�/�/�/�����	0��������f�h�h�'�'�'�
�
�
�0�
1�
1�	�	�
�A�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s"��
?�:�?�>B�B�Bc�8�	t���#t$r&}|�|t��~Yd}~nd}~wwxYw|�dt����|�t
��5|ddd��dS#1swxYwYdSrOrPrs  r�test_exception_cleanup_names2z,ExceptionTests.test_exception_cleanup_names2�s���	��+�+����	�	�	��!�!�!�Y�/�/�/�����������	����	
����f�h�h�'�'�'�
�
�
�0�
1�
1�	�	�
�A�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s$��
A�;�A�?B�B�Bc����Gd�dt���Gd�d��}��fd�}|���tj���}	|��n#�$r
}Yd}~nd}~wwxYwd�t��|���|����|���tj���}	|��n#�$rYnwxYwd�t��|���|����|���tj���}	|��n#YnxYwd�t��|���|����|���tj���}dD]}	|���#YnxYwd�t��|���|����|���tj���}		|��n#t
�xYwnk#t
$r^}d|_d�t��|���td���rt��|����Yd}~nd}~wwxYw|���tj���}	|��n#�$r		�#�xYw#�$rYnwxYwYnwxYwd�td���rt��|���|����Gd	�d
��}|���tj���}|��5|��ddd��n#1swxYwYd�td���rt��|���|����dS)Nc��eZdZd�ZdS)�=ExceptionTests.testExceptionCleanupState.<locals>.MyExceptionc��||_dSr��obj�rr\s  rrzFExceptionTests.testExceptionCleanupState.<locals>.MyException.__init__��
������rNrr rrr#rY��#������
�
�
�
�
rr#c��eZdZdS)�7ExceptionTests.testExceptionCleanupState.<locals>.MyObjNr�r rr�MyObjra�r�rrbc����}�����rr )�	local_refr#r\s ��r�inner_raising_funczDExceptionTests.testExceptionCleanupState.<locals>.inner_raising_func�s����I��+�c�"�"�"r)rF)�cpythonc��eZdZd�Zd�ZdS)�9ExceptionTests.testExceptionCleanupState.<locals>.Contextc��|Srr r*s r�	__enter__zCExceptionTests.testExceptionCleanupState.<locals>.Context.__enter__2����rc��dS)NTr )r�exc_type�	exc_value�exc_tbs    r�__exit__zBExceptionTests.testExceptionCleanupState.<locals>.Context.__exit__4s���trN�rrrrjrpr rr�Contextrh1s2������
�
�
�
�
�
�
�
rrr)r)�weakref�refrr7rGr.r)	rrbre�wrrn�irrr#r\s	       @@r�testExceptionCleanupStatez(ExceptionTests.testExceptionCleanupState�s�����	�	�	�	�	�)�	�	�	�	�	�	�	�	�	�	�	�	#�	#�	#�	#�	#�	#��e�g�g��
�[��
�
��	��� � � � ���	�	�	��D�D�D�D�����	�����������b�d�d�����#�����e�g�g��
�[��
�
��	��� � � � ���	�	�	��D�	�����������b�d�d�����#�����e�g�g��
�[��
�
��	��� � � � ��	��D�����������b�d�d�����#�����e�g�g��
�[��
�
���	�	�A�
�"�"�$�$�$�$��
��������������b�d�d�����#�����e�g�g��
�[��
�
��	#�
�"�"�$�$�$�$��
������%���	#�	#�	#�
!�A�M��C��L�L�L��"�$�$�C� ��/�/�/�
��������c�"�"�"�"�"�"�"�"�����	#�����e�g�g��
�[��
�
��		��� � � � ���	�	�	�
�����E�E�E���
�
�
���
������	�������U�+�+�+�	��L�L�L��b�d�d�����#����	�	�	�	�	�	�	�	�
�e�g�g��
�[��
�
��
�W�Y�Y�	!�	!��� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!����U�+�+�+�	��L�L�L��b�d�d�����#�����s��
A�A"�A"�3
B>�>C�C�
D"�"D&�;
F�F�
G(�'G5�(	G1�1G5�5
I�?AI�I�?
J
�
J%�J�J�J�J�J%�J�J%�$J%�L3�3L7�:L7c�f���fd�}	tdS#t$r�|��Yd��dSd��wwxYw)Nc����dSrr rs�r�print_errorzIExceptionTests.test_exception_target_in_nested_scope.<locals>.print_errorCs���
�A�A�Ar)�	somethingr))rrzrns  @r�%test_exception_target_in_nested_scopez4ExceptionTests.test_exception_target_in_nested_scope@s`���	�	�	�	�	�	��I�I�I���	�	�	��K�M�M�M�M�M�M�M�M�M�����	���s��
0�
+�0c�,�d�}|��}|�t|��t��|�tj��dd��|�t|��t��|�tj��dd��|�t|��d��	td���#t
$�r|��}|�t|��t��|�tj��dt
��|�t|��t��|�tj��dt
��|�t|��t
��~|�tj��dt
��YdSwxYw)Nc3��K�	td���#t$r9tj��dV�tj��dV�YnwxYwtj��dV�dS)N�caughtr)rGr]r�r rr�yield_raisez:ExceptionTests.test_generator_leaking.<locals>.yield_raiseNs�����
(��x�(�(�(���
(�
(�
(��l�n�n�Q�'�'�'�'��l�n�n�Q�'�'�'�'�'�'�
(�����,�.�.��#�#�#�#�#�#s��AA�Arr�)r4�nextrGr]r�rW)rr�rIs   r�test_generator_leakingz%ExceptionTests.test_generator_leakingKs���	$�	$�	$�
�K�M�M������a���(�+�+�+���������*�D�1�1�1�����a���(�+�+�+���������*�D�1�1�1�����a���$�'�'�'�
	;��E�"�"�"���	;�	;�	;���
�
�A����T�!�W�W�h�/�/�/����S�\�^�^�A�.�	�:�:�:����T�!�W�W�h�/�/�/����S�\�^�^�A�.�	�:�:�:����T�!�W�W�i�0�0�0�����S�\�^�^�A�.�	�:�:�:�:�:�:�	;���s�C+�+D$H�Hc��d�}	t�#t$r|��}t|��YnwxYw	t|��n#t$rYnwxYw|�t	j��d��dS)Nc3�K�dV�dSrr r rrrIz1ExceptionTests.test_generator_leaking2.<locals>.gks�����E�E�E�E�Er�NNN)rOr��
StopIterationr4r]r��rrI�its   r�test_generator_leaking2z&ExceptionTests.test_generator_leaking2is���	�	�	�	�����	�	�	�����B���H�H�H�H�H�	����	���H�H�H�H���	�	�	��D�	�����������);�<�<�<�<�<s��#2�2�A�
A�Ac���d�}|��}t|��	ddzn�#t$r�}|�tj��d|��|�|��}|�tj��d|��|�||��Yd}~nd}~wwxYw|�tj��d��dS)Nc3�lK�	dV�dS#t$rtj��dV�YdSwxYw�NrM�rYr]r�r rrrIz1ExceptionTests.test_generator_leaking3.<locals>.g{sS����
(��������$�
(�
(�
(��l�n�n�Q�'�'�'�'�'�'�'�
(���s�
�%3�3rMrr�)r�rYr�r]r��throwr4)rrIr�rn�gen_excs     r�test_generator_leaking3z&ExceptionTests.test_generator_leaking3xs���	(�	(�	(�
�Q�S�S���R����	&�
�a�C�C�C�� �	&�	&�	&��M�M�#�,�.�.��+�Q�/�/�/��h�h�q�k�k�G��M�M�#�,�.�.��+�Q�/�/�/��M�M�'�1�%�%�%�%�%�%�%�%�����		&����
	
�������);�<�<�<�<�<s�$�
B=�BB8�8B=c��d�}|��}	t�#t$rt|��}YnwxYw|�|t��	t|��nD#t$r7}|�t	j��d|��Yd}~nd}~wwxYw|�t	j��d��dS)Nc3�jK�	ddzdS#t$rtj��dV��wxYw�NrMrr�r rrrIz1ExceptionTests.test_generator_leaking4.<locals>.g�sM����
��!������$�
�
�
��l�n�n�Q�'�'�'�'��
���s��'2rMr�)rWr�r�rYr]r�r4)rrIr��tprns     r�test_generator_leaking4z&ExceptionTests.test_generator_leaking4�s���	�	�	��Q�S�S��	��O���	�	�	��b���B�B�B�	����	
�
�
�b�+�,�,�,�	0���H�H�H�H��!�	0�	0�	0��M�M�#�,�.�.��+�Q�/�/�/�/�/�/�/�/�����	0����	
�������);�<�<�<�<�<s$��2�2�A!�!
B"�+-B�B"c����fd�}|��}	t�#t$rt|��YnwxYw��tt|��dS)Nc3���K���tj��dt��dV���tj��d��dS)NrMr�)r%r]r�rOr4r*s�rrIz>ExceptionTests.test_generator_doesnt_retain_old_exc.<locals>.g�sT������!�!�#�,�.�.��"3�\�B�B�B��E�E�E����S�\�^�^�-?�@�@�@�@�@r)rOr�r[r�r�s`  r�$test_generator_doesnt_retain_old_excz3ExceptionTests.test_generator_doesnt_retain_old_exc�s����	A�	A�	A�	A�	A��Q�S�S��	�����	�	�	���H�H�H�H�H�	�������-��r�2�2�2�2�2s��5�5c���d���fd�}|��t��|�tj��d��dS)Nc3�K�dV�dSr�r r rr�
simple_genzIExceptionTests.test_generator_finalizing_and_exc_info.<locals>.simple_gen�s�����G�G�G�G�Grc�f�����}	t�#t$rt|��cYSwxYwr)rOr�)�genr�s �r�run_genzFExceptionTests.test_generator_finalizing_and_exc_info.<locals>.run_gen�sF����*�,�,�C�
!�"�"���
!�
!�
!��C�y�y� � � �
!���s��0�0r�)rr4r]r�)rr�r�s  @r�&test_generator_finalizing_and_exc_infoz5ExceptionTests.test_generator_finalizing_and_exc_info�sd���	�	�	�	!�	!�	!�	!�	!�	��	�	�	������������);�<�<�<�<�<rc�<���Gd�dt���Gd�d��}��fd�}|���tj���}|��}t|��||��dx}�t	��|���|����dS)Nc��eZdZd�ZdS)�FExceptionTests._check_generator_cleanup_exc_state.<locals>.MyExceptionc��||_dSrr[r]s  rrzOExceptionTests._check_generator_cleanup_exc_state.<locals>.MyException.__init__�r^rNrr rrr#r��r_rr#c��eZdZdS)�@ExceptionTests._check_generator_cleanup_exc_state.<locals>.MyObjNr�r rrrbr��r�rrbc3�@�K�	�����#�$rdV�YdSwxYwrr )r#r\s��r�raising_genzFExceptionTests._check_generator_cleanup_exc_state.<locals>.raising_gen�sF�����
�!�k�#�&�&�&���
�
�
��������
���s��	�)r)rsrtr�rr7)r�testfuncrbr�rurIr#r\s      @@r�"_check_generator_cleanup_exc_statez1ExceptionTests._check_generator_cleanup_exc_state�s�����	�	�	�	�	�)�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��e�g�g��
�[��
�
���K�M�M���Q�������������C������b�d�d�����#�����rc�6�d�}|�|��dS)Nc�l�	|�t����dS#t$rYdSwxYwr)r�rOrHs r�do_throwzGExceptionTests.test_generator_throw_cleanup_exc_state.<locals>.do_throw�sE��
�������'�'�'�'�'���
�
�
����
���s�!%�
3�3�r�)rr�s  r�&test_generator_throw_cleanup_exc_statez5ExceptionTests.test_generator_throw_cleanup_exc_state�s-��	�	�	�
	
�/�/��9�9�9�9�9rc�6�d�}|�|��dS)Nc�.�|���dSr)r_rHs r�do_closezGExceptionTests.test_generator_close_cleanup_exc_state.<locals>.do_close�s��
�G�G�I�I�I�I�Irr�)rr�s  r�&test_generator_close_cleanup_exc_statez5ExceptionTests.test_generator_close_cleanup_exc_state�s+��	�	�	��/�/��9�9�9�9�9rc�6�d�}|�|��dS)Nc�
�d}dSrr rHs r�do_delzCExceptionTests.test_generator_del_cleanup_exc_state.<locals>.do_del�s���A�A�Arr�)rr�s  r�$test_generator_del_cleanup_exc_statez3ExceptionTests.test_generator_del_cleanup_exc_state�s+��	�	�	��/�/��7�7�7�7�7rc�<���fd�}��|��dS)Nc�t��	t|����d��dS#t$rYdSwxYw�Nz should have raised StopIteration)r�rhr��rIrs �r�do_nextzEExceptionTests.test_generator_next_cleanup_exc_state.<locals>.do_next�sR���
>��Q�����	�	�<�=�=�=�=�=��!�
�
�
����
���s�)�
7�7r�)rr�s` r�%test_generator_next_cleanup_exc_statez4ExceptionTests.test_generator_next_cleanup_exc_state��8���	>�	>�	>�	>�	>�	
�/�/��8�8�8�8�8rc�<���fd�}��|��dS)Nc���	|�d����d��dS#t$rYdSwxYwr�)�sendrhr�r�s �r�do_sendzEExceptionTests.test_generator_send_cleanup_exc_state.<locals>.do_send�sV���
>����t�����	�	�<�=�=�=�=�=��!�
�
�
����
���s�/�
=�=r�)rr�s` r�%test_generator_send_cleanup_exc_statez4ExceptionTests.test_generator_send_cleanup_exc_state�r�rc���G�fd�d��}d�	t|�����#YnxYwt��|��d��dS)Nc���eZdZ�fd�ZdS)�*ExceptionTests.test_3114.<locals>.MyObjectc�.��tj���dSr)r]r�rs �r�__del__z2ExceptionTests.test_3114.<locals>.MyObject.__del__s����L�N�N���rN�rrrr�rs�r�MyObjectr�s.�������
#�
#�
#�
#�
#�
#�
#rr�r r�)r)rr4)rr�rns  @r�	test_3114zExceptionTests.test_3114�s����	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�
��	��H�H�J�J�'�'�'��	��D������������.�/�/�/�/�/s�+�/c��Gd�dt��}Gd�dt��}Gd�dt��}		|�#|$r�}|}	|�#|$r�}|}	|�#|$r�}|}	|�||��|�||��|�|	|��|�|j��|�|j|��|�|	j|��|�d}~wwxYwd}~wwxYwd}~wwxYw#|$r}
|
}Yd}
~
nd}
~
wwxYw|�||��|�|j|	��|�|	j|��|�|j��dS)Nc��eZdZdS)�HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.ANr�r rr�Ar�r�rr�c��eZdZdS)�HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.BNr�r rr�Br�r�rr�c��eZdZdS)�HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.CNr�r rr�Cr�r�rr�)r)r%r7r.r�)rr�r�r��a_r��b_rL�c_�crnr/s            r�.test_raise_does_not_create_context_chain_cyclez=ExceptionTests.test_raise_does_not_create_context_chain_cycles&��	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�
 �����
 �
 �
 ��� ��G��� � � ��A�
 ����� � � ����-�-�a��3�3�3��-�-�a��3�3�3��-�-�a��3�3�3��)�)�!�-�8�8�8��
�
�a�m�Q�7�7�7��
�
�a�m�Q�7�7�7������� ��������	 ��������	
 �����"�	�	�	��C�C�C�C�C�C�����	����	
�
�
�c�1�����
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'����!�-�(�(�(�(�(sj�>�D�C=�A�C:�
C5�A�C2�BC-�-C2�2C5�5C:�:C=�=D�D�D�
D�Dc��d�}	|��n#t$r}|}Yd}~nd}~wwxYw|�|t��|�|jt��|�|jj|j��dS)Nc�r�	td���#t$r}||_td���d}~wwxYw�NrMr�)rXr.rW��exs r�cyclezBExceptionTests.test_no_hang_on_context_chain_cycle1.<locals>.cycle9sE��
#� ��m�m�#���
#�
#�
#�!#�����l�l�"�����
#���s��
6�1�6)r)r%rWr.rXr�)rr�rnr/s    r�$test_no_hang_on_context_chain_cycle1z3ExceptionTests.test_no_hang_on_context_chain_cycle16s���	#�	#�	#�	��E�G�G�G�G���	�	�	��C�C�C�C�C�C�����	����	
���c�9�-�-�-����c�o�z�:�:�:��
�
�c�o�1�3�?�C�C�C�C�Cs�
�
&�!�&zSee issue 44895c�@�Gd�dt��}Gd�dt��}Gd�dt��}|�|��5}	|���#|$rD}|}	|���#|$r*}|}	|���#|$r}	|	}
|
|_|
�d}	~	wwxYwd}~wwxYwd}~wwxYw#1swxYwY|�|j|
��|�|
j|��|�|j|��|�|j|
��dS)Nc��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.ANr�r rrr�r�Mr�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.BNr�r rrr�r�Or�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.CNr�r rrr�r�Qr�rr��r)r[r.r�r~)rr�r�r�r��_ar��_brL�_cr�s           r�$test_no_hang_on_context_chain_cycle2z3ExceptionTests.test_no_hang_on_context_chain_cycle2Is���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��
�
�q�
!�
!�	 �R�

 ��a�c�c�	���
 �
 �
 ���	 ��!�#�#�I��� � � ��A� ��a�c�c�	��� � � ���()��
������� ��������	 ��������	
 ����	 �	 �	 �	 ����	 �	 �	 �	 � 	
�
�
�b�l�A�&�&�&��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'�'�'sl�B'�
A�B$� B�#
A-�-B�2B�5
A?�?B	�B	�B	�B�B�B�B$�$B'�'B+�.B+c�@�Gd�dt��}Gd�dt��}Gd�dt��}Gd�dt��}Gd	�d
t��}|�|��5}	|���#|$rh}|}	|���#|$rN}	|	}
	|���#|$r4}|}||_	|���#|$r}
|
}|��}|�d}
~
wwxYwd}~wwxYwd}	~	wwxYwd}~wwxYw#1swxYwY|�|j|��|�|j|��|�|j|��|�|j|
��|�|
j|��|�|j|��dS)Nc��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.ANr�r rrr�r�qr�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.BNr�r rrr�r�sr�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.CNr�r rrr�r�ur�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.DNr�r rr�Dr�wr�rr�c��eZdZdS)�>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.ENr�r rr�Er�yr�rr�r�)rr�r�r�r�r�r�r�r�r�rLr�r��_d�drns                r�$test_no_hang_on_context_chain_cycle3z3ExceptionTests.test_no_hang_on_context_chain_cycle3ns���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��
�
�q�
!�
!�	$�R�
$��a�c�c�	���
$�
$�
$���$��!�#�#�I���$�$�$��A�
$��a�c�c�	���$�$�$���()��
�$�"#�!�#�#�I�� �$�$�$� "�A� !����A�"#�G�����$��������$��������	$��������	
$����	$�	$�	$�	$����	$�	$�	$�	$�*	
�
�
�b�l�A�&�&�&��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'��
�
�a�m�Q�'�'�'�'�'s��5C1�7
B�C.�C)�	
B�C&�C!�
B%�%C	�*	C	�4
B>�>C�C�C�C	�C	�C!�!C&�&C)�)C.�.C1�1C5�8C5c���		td��}|�#td��}|�xYw#t$r}|}Yd}~nd}~wwxYw|�||��|�|j|��dSr�)rWrXr)r�r.)r�te�vernr/s     r�,test_context_of_exception_in_try_and_finallyz;ExceptionTests.test_context_of_exception_in_try_and_finally�s���	�
��q�\�\�������]�]���������	�	�	��C�C�C�C�C�C�����	����	
�
�
�c�2�����
�
�c�o�r�*�*�*�*�*s��&�)�
?�:�?c�V�		td��}|�#td��}|�xYw#td��}|�xYw#t$r}|}Yd}~nd}~wwxYw|�||��|�|j|��|�|jj|��dS)NrMr�r�)rWrXrBr)r�r.)rr�r��oernr/s      r�/test_context_of_exception_in_except_and_finallyz>ExceptionTests.test_context_of_exception_in_except_and_finally�s���	�
��q�\�\�����
���]�]���������Q�Z�Z���������	�	�	��C�C�C�C�C�C�����	����	
�
�
�c�2�����
�
�c�o�r�*�*�*��
�
�c�o�1�2�6�6�6�6�6s%��'�*�<�?�
A�	A�Ac��			td��}|�#YnxYw	td��}|�#td��}|�xYw#t$r}|}Yd}~nd}~wwxYw|�||��|�|j|��dSr�)rXrBr)r�r.)rr�rrnr/s     r�-test_context_of_exception_in_else_and_finallyz<ExceptionTests.test_context_of_exception_in_else_and_finally�s���	�	
�� ��]�]�����	
�������
�Q�Z�Z������Q�Z�Z���������	�	�	��C�C�C�C�C�C�����	����	
�
�
�c�2�����
�
�c�o�r�*�*�*�*�*s.�.��.�A�A�A�
A�
A�Ac��tddddd��}|�t|��d��d|_|�t|��d��d|_d	|_|�t|��d
��d|_|�t|��d��d
|_|�t|��d��tddddd��}|�t|��d��d|_|�t|��d��d|_d	|_|�t|��d��d|_|�t|��d��d
|_|�t|��d��tdddd��}|�t|��d��d|_|�t|��d��d|_d	|_|�t|��d��d
|_|�t|��d��dS)Nr��xxxxxrMr�r�z8'baz' codec can't encode characters in position 1-4: foor�z<'baz' codec can't encode character '\x78' in position 1: foolESh
MQ)EzJ'baz' codec can't encode characters in position 1-4: 965230951443685724997i�zK'4000' codec can't encode characters in position 1-4: 965230951443685724997i�zN'4000' codec can't encode characters in position 1000-4: 965230951443685724997sxxxxxz3'baz' codec can't decode bytes in position 1-4: fooz5'baz' codec can't decode byte 0x78 in position 1: foozE'baz' codec can't decode bytes in position 1-4: 965230951443685724997zF'4000' codec can't decode bytes in position 1-4: 965230951443685724997zI'4000' codec can't decode bytes in position 1000-4: 965230951443685724997�xxxxz/can't translate characters in position 1-4: fooz3can't translate character '\x78' in position 1: foozAcan't translate characters in position 1-4: 965230951443685724997zDcan't translate characters in position 1000-4: 965230951443685724997)	rr4r3r�r�r@r�rr)r�us  r�test_unicode_change_attributesz-ExceptionTests.test_unicode_change_attributes�s?��
�u�g�q�!�U�;�;������Q���![�\�\�\��������Q���!`�a�a�a����'�������Q���!m�n�n�n���
�����Q���!n�o�o�o��������Q���!q�r�r�r��u�h��1�e�<�<������Q���!V�W�W�W��������Q���!X�Y�Y�Y����'�������Q���!h�i�i�i���
�����Q���!i�j�j�j��������Q���!l�m�m�m�!�&�!�Q��6�6������Q���!R�S�S�S��������Q���!W�X�X�X����'�������Q���!d�e�e�e��������Q���!g�h�h�h�h�hrc��tttf}|D]8}|�t	|�|����d���9dS)N�)rrrr4r3�__new__)r�klasses�klasss   r�test_unicode_errors_no_objectz,ExceptionTests.test_unicode_errors_no_object�sV��$�&8�:O�O���	<�	<�E����S����u�!5�!5�6�6��;�;�;�;�	<�	<rc���Gd�dt��}Gd�dt|���}t��5}	t���#|$r}|�d��Yd}~n*d}~wt$rYn|�d��YnxYwddd��n#1swxYwY�fd�����\}}}|�|tt|����|�d	t|����dS)
Nc��eZdZd�ZdS)�/ExceptionTests.test_badisinstance.<locals>.Metac��t���rrG)�cls�subclasss  r�__subclasscheck__zAExceptionTests.test_badisinstance.<locals>.Meta.__subclasscheck__�s�� �l�l�"rN)rrrrr rr�Metar�s#������
#�
#�
#�
#�
#rrc��eZdZdS)�6ExceptionTests.test_badisinstance.<locals>.MyExceptionNr�r rrr#rr�rr#)�	metaclasszShould have raised KeyErrorz%exception should not be a MyExceptionc�`��	���S#t$rtj��cYSwxYwr)rPr]r�rHs�rrIz,ExceptionTests.test_badisinstance.<locals>.gs@���
&��q�s�s�
��!�
&�
&�
&��|�~�~�%�%�%�
&���s�	
�-�-z maximum recursion depth exceeded)	rr)rrGrhr%rPr�r3)rrr#rrn�vr�rIs       @r�test_badisinstancez!ExceptionTests.test_badisinstance�s����	#�	#�	#�	#�	#�4�	#�	#�	#�	�	�	�	�	�)�t�	�	�	�	��
�
�
	9�&�	
9��j�j� ���
C�
C�
C��	�	�A�B�B�B�B�B�B�B�B������
�
�
���
9��	�	�7�8�8�8�8�8����
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9�
	9����
	9�
	9�
	9�
	9�	&�	&�	&�	&�	&�
�1�3�3���1�b����a���a���9�9�9��
�
�8�#�a�&�&�A�A�A�A�As@�B�A�B�
A'�"B�'
B�4B�6B�B�B!�$B!c�F�d�}|��tj��dS)Nc�T�t��}td��D]	}|j}�
dS)Ni@B)r�rf�__dir__)�ors  rr�z3ExceptionTests.test_trashcan_recursion.<locals>.foos7�����A��9�%�%�
�
���I���
�
r)rr)rr�s  r�test_trashcan_recursionz&ExceptionTests.test_trashcan_recursions3��	�	�	�	�����������rc��dtz}tjdd|��\}}}|�|d��|�d|��|�d|��|�d|��dS)Na�if 1:
            import sys
            from _testinternalcapi import get_recursion_depth

            class MyException(Exception): pass

            def setrecursionlimit(depth):
                while 1:
                    try:
                        sys.setrecursionlimit(depth)
                        return depth
                    except RecursionError:
                        # sys.setrecursionlimit() raises a RecursionError if
                        # the new recursion limit is too low (issue #25274).
                        depth += 1

            def recurse(cnt):
                cnt -= 1
                if cnt:
                    recurse(cnt)
                else:
                    generator.throw(MyException)

            def gen():
                f = open(%a, mode='rb', buffering=0)
                yield

            generator = gen()
            next(generator)
            recursionlimit = sys.getrecursionlimit()
            depth = get_recursion_depth()
            try:
                # Upon the last recursive invocation of recurse(),
                # tstate->recursion_depth is equal to (recursion_limit - 1)
                # and is equal to recursion_limit when _gen_throw() calls
                # PyErr_NormalizeException().
                recurse(setrecursionlimit(depth + 2) - depth)
            finally:
                sys.setrecursionlimit(recursionlimit)
                print('Done.')
        �-Wd�-crMsRecursionErrorsResourceWarning�Done.)�__file__r	�assert_python_failurer4r��rr��rc�outr5s     r�$test_recursion_normalizing_exceptionz3ExceptionTests.test_recursion_normalizing_exception(s���(�P�Q(��R%�:�5�$��M�M���C������Q�����
�
�'��-�-�-��
�
�(�#�.�.�.��
�
�h��$�$�$�$�$rc��d}tjd|��\}}}|�|d��|�d|��|�d|��dS)Nz�if 1:
            import _testcapi
            try:
                raise _testcapi.RecursingInfinitelyError
            finally:
                print('Done.')
        r&rMsORecursionError: maximum recursion depth exceeded while normalizing an exceptionr')r	r)r4r�r*s     r�-test_recursion_normalizing_infinite_exceptionz<ExceptionTests.test_recursion_normalizing_infinite_exceptioncsq��
��%�:�4��F�F���C������Q�����
�
�8�9<�	>�	>�	>��
�
�h��$�$�$�$�$rc�����d�}�fd���fd���fd��tj��}	|d�����fD]a}|�|���5	|��|�d��n#t$rYnwxYwddd��n#1swxYwY�b	tj|��dS#tj|��wxYw)Nc��d}		tj|��n#t$r|dz
}YnwxYw�,tj||z��dSr�)r]�setrecursionlimitrP)�n�depths  r�set_relative_recursion_limitzUExceptionTests.test_recursion_in_except_handler.<locals>.set_relative_recursion_limitxss���E�
���)�%�0�0�0���&�����Q�J�E�E�E�����
�
�!�%��'�*�*�*�*�*s��,�,c�8��	ddzdS#���YdSxYwr�r )�recurse_in_excepts�rr7zJExceptionTests.test_recursion_in_except_handler.<locals>.recurse_in_except�s6���
$��!������
$�!�!�#�#�#�#�#�#���s�
�c�8��	ddzn#YnxYw���dSr�r )�recurse_after_excepts�rr9zMExceptionTests.test_recursion_in_except_handler.<locals>.recurse_after_except�s6���
��!�����
������ � �"�"�"�"�"s�	�
c�B��	���dS#���YdSxYwrr )�recurse_in_body_and_excepts�rr;zSExceptionTests.test_recursion_in_except_handler.<locals>.recurse_in_body_and_except�s>���
-�*�*�,�,�,�,�,��
-�*�*�,�,�,�,�,�,���s�
�rF)�funcz#Should have raised a RecursionError)r]�getrecursionlimitr2rhrPr2)rr5�recursionlimitr<r9r;r7s    @@@r� test_recursion_in_except_handlerz/ExceptionTests.test_recursion_in_except_handlervs������		+�		+�		+�	$�	$�	$�	$�	$�	#�	#�	#�	#�	#�	-�	-�	-�	-�	-��.�0�0��	2�(�(��,�,�,�*�,@�B\�]�
I�
I���\�\�t�\�,�,�I�I�I�������	�	�"G�H�H�H�H��*����������I�I�I�I�I�I�I�I�I�I�I����I�I�I�I��
I�
�!�.�1�1�1�1�1��C�!�.�1�1�1�1���sS�(B3�B�
A4�B�4
B�>B�B�B�B3�B	�B3�B	�B3�3C	c��d}t��5tjd|��\}}}|�d|��ddd��dS#1swxYwYdS)Na+if 1:
            import _testcapi
            class C(): pass
            def recurse(cnt):
                cnt -= 1
                if cnt:
                    recurse(cnt)
                else:
                    _testcapi.set_nomemory(0)
                    C()
            recurse(16)
        r&�MemoryError)r
r	r)r�r*s     r�)test_recursion_normalizing_with_no_memoryz8ExceptionTests.test_recursion_normalizing_with_no_memory�s�����!�
"�
"�	/�	/�(�>�t�T�J�J�L�B��S��M�M�.�#�.�.�.�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/�	/����	/�	/�	/�	/�	/�	/s�0A�A�Ac�����ddl�ddlm����fd�}|��}|��}��||��dS)Nr��raise_memoryerrorc���	�����d��n#t$r}|j}Yd}~nd}~wwxYw��|��S)Nz Should have raised a MemoryError)rhrJr&�	format_tb)rnr�rEr�	tracebacks  ���r�
raiseMemErrorz6ExceptionTests.test_MemoryError.<locals>.raiseMemError�sw���
>�!�!�#�#�#��	�	�<�=�=�=�=���
%�
%�
%��_�����������
%�����&�&�r�*�*�*s�
#�
>�9�>)rHr�rEr4)rrI�tb1�tb2rErHs`   @@r�test_MemoryErrorzExceptionTests.test_MemoryError�s|�����	����/�/�/�/�/�/�	+�	+�	+�	+�	+�	+�	+��m�o�o���m�o�o������c�"�"�"�"�"rc�,�ddl}d}d}|�t|jd��|�d��}|�t|��t
��|�t|t����|�	|j
��|�d|��}|�|j
|��|�d|���}|�t||����Gd	�d
t��}|�d|||f��}|�t||����|�t||����|�|j
|��|�dd
|ddi��}	|�t|	|����|�|	j
d��|�|	j
d
��dS)NrzThis is a test docstring.zThis is another test docstring.�error1z_testcapi.error1z_testcapi.error2z_testcapi.error3)�basec��eZdZdS)�1ExceptionTests.test_exception_with_doc.<locals>.CNr�r rrr�rQ�r�rr�z_testcapi.error4z_testcapi.error5rr�rM)r�r[rU�make_exception_with_docr�rr��
issubclassr)r7�__doc__r4r�r�)
rr��doc2�doc4rN�error2�error3r��error4�error5s
          r�test_exception_with_docz&ExceptionTests.test_exception_with_doc�s"������*��0�����+�y�'H�"�	$�	$�	$��2�2�3E�F�F���
�
�d�6�l�l�D�)�)�)����
�6�9�5�5�6�6�6����&�.�)�)�)��2�2�3E�t�L�L��������.�.�.��2�2�3E�8>�3�@�@�����
�6�6�2�2�3�3�3�	�	�	�	�	��	�	�	��2�2�3E�t�4:�A�;�@�@�����
�6�6�2�2�3�3�3����
�6�1�-�-�.�.�.�������.�.�.��2�2�3E�r�39�C��8�E�E�����
�6�6�2�2�3�3�3������1�%�%�%�������,�,�,�,�,rc�H����ddlm�Gd�d���d����fd�}	|��|�d��n5#t$r(}|����d��Yd}~nd}~wwxYwt��|����d��dS)NrrDc��eZdZdS)�3ExceptionTests.test_memory_error_cleanup.<locals>.CNr�r rrr�r^�r�rr�c�X�����}tj|������dSr�rsrt)r�r�rErus ���r�innerz7ExceptionTests.test_memory_error_cleanup.<locals>.inner�s0�������A���Q���B�������rzMemoryError not raised)r�rErhrJ�assertNotEqualrr4)rrarnr�rErus   @@@r�test_memory_error_cleanupz(ExceptionTests.test_memory_error_cleanup�s
�����	0�/�/�/�/�/�	�	�	�	�	�	�	�	�
��	 �	 �	 �	 �	 �	 �	 �	0��E�G�G�G�
�I�I�.�/�/�/�/���	,�	,�	,��������d�+�+�+�+�+�+�+�+�����	,����	�����������t�$�$�$�$�$s�
A�
A3�A.�.A3c�<����Gd�d���d����fd��	���|�d��n5#t$r(}|����d��Yd}~nd}~wwxYwt��|����d��dS)Nc��eZdZdS)�6ExceptionTests.test_recursion_error_cleanup.<locals>.CNr�r rrr�rfr�rr�c�X�����}tj|������dSrr`)r�r�rarus ���rraz:ExceptionTests.test_recursion_error_cleanup.<locals>.inners*�������A���Q���B��E�G�G�G�G�GrzRecursionError not raised)rhrPrbrr4)rrnr�rarus  @@@r�test_recursion_error_cleanupz+ExceptionTests.test_recursion_error_cleanup
s������	�	�	�	�	�	�	�	�
��	�	�	�	�	�	�	�	3��E�G�G�G�
�I�I�1�2�2�2�2���	,�	,�	,��������d�+�+�+�+�+�+�+�+�����	,����	�����������t�$�$�$�$�$s�
;�
A-�A(�(A-c��|�t��5}tjt��ddd��n#1swxYwY|�|jjtj|j��dSr)	r[rB�os�listdirr(r4r~r��ENOTDIR)rr�s  r�test_errno_ENOTDIRz!ExceptionTests.test_errno_ENOTDIR"s���
�
�
�w�
'�
'�	!�2��J�x� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!������+�U�]�B�L�I�I�I�I�Is�A�A�Ac�2�Gd�d��}|��}tj��5}~t��|�|jj|j��|�|jj��ddd��dS#1swxYwYdS)Nc��eZdZd�ZdS)�1ExceptionTests.test_unraisable.<locals>.BrokenDelc�$�td��}|�)Nz
del is brokenrG�rr/s  rr�z9ExceptionTests.test_unraisable.<locals>.BrokenDel.__del__+s�� ��1�1���	rNr�r rr�	BrokenDelrp*s#������
�
�
�
�
rrs)	r�catch_unraisable_exceptionrr4�
unraisabler�r��assertIsNotNone�
exc_traceback)rrsr\r�s    r�test_unraisablezExceptionTests.test_unraisable(s���	�	�	�	�	�	�	�	��i�k�k��
�
/�
1�
1�	>�R���L�L�L����R�]�1�9�3D�E�E�E�� � ���!<�=�=�=�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>����	>�	>�	>�	>�	>�	>s�AB�B�Bc	��ttfD�]G}|�|��5	|d��}|�#|$rHt��5}t	jt	j���ddd��n#1swxYwYYnwxYw|���}|�d|��|�d|��|�|j	|��|tur|�d|��n|�d|��|�
|�d����ddd��n#1swxYwY��IdS)Nztest messager�z	raise excz<exception str() failed>r�)rXr&r2rr]�__excepthook__r��getvaluer�rr�r�)rrmr/r�reports     r�test_unhandledzExceptionTests.test_unhandled8s���#�%7�8�	7�	7�H����h�'�'�
7�
7�<�"�(�>�2�2�C��I���<�<�<�(�*�*�<�f��*�C�L�N�N�;�;�<�<�<�<�<�<�<�<�<�<�<����<�<�<�<���<���� ���*�*���
�
�2�F�;�;�;��
�
�k�6�2�2�2��
�
�h�/��8�8�8��1�1�1��M�M�"<�f�E�E�E�E��M�M�.�&�9�9�9�������� 5� 5�6�6�6�!
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7����
7�
7�
7�
7��	7�	7sQ�E�
6�B�	 A5	�)B�5A9
�9B�<A9
�=B�E�B�B<E�E	�E	c��d}tdd��D]J}tjd||z��\}}}|�|d��|�d|���KdS)Nz�if 1:
            import _testcapi
            class C(): pass
            _testcapi.set_nomemory(0, %d)
            C()
        rMr�r&)rM�xrA)rfr	r)r�)rr�rvr+r,r5s      r�"test_memory_error_in_PyErr_PrintExz1ExceptionTests.test_memory_error_in_PyErr_PrintExMss�����q�"���	/�	/�A�(�>�t�T�A�X�N�N�L�B��S��M�M�"�h�'�'�'��M�M�.�#�.�.�.�.�	/�	/rc�6���Gd�dt���Gd�dt�����fd�}|��}|�d��|����5|������ddd��dS#1swxYwYdS)Nc��eZdZdS)�BExceptionTests.test_yield_in_nested_try_excepts.<locals>.MainErrorNr�r rr�	MainErrorr�`r�rr�c��eZdZdS)�AExceptionTests.test_yield_in_nested_try_excepts.<locals>.SubErrorNr�r rr�SubErrorr�cr�rr�c3�T�K�	����#�$r	dV�n#�$rYnwxYw�wxYwrr )r�r�s��r�mainz=ExceptionTests.test_yield_in_nested_try_excepts.<locals>.mainfsf�����
��i�k�k�!���
�
�
���E�E�E�E�������D������
���s �
�'��'�"�'�"�')r)r�r[r�)rr��coror�r�s   @@r� test_yield_in_nested_try_exceptsz/ExceptionTests.test_yield_in_nested_try_excepts^s"����	�	�	�	�	�	�	�	�	�	�	�	�	�	�y�	�	�	�	�	�	�	�	�	��t�v�v���	�	�$����
�
�
�y�
)�
)�	#�	#��J�J�x�x�z�z�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s�#B�B�Bc�����fd�}|��}	t�#t$r&��t|��d��YnwxYw��t|��d��dS)Nc3��K�	t�#t$rdV�YnwxYw��tj��d��dV�dS)NrMr�r�)rXr4r]r�r*s�rrIz?ExceptionTests.test_generator_doesnt_retain_old_exc2.<locals>.gwsd�����
� � ���
�
�
�������
�������S�\�^�^�-?�@�@�@��G�G�G�G�Gs���rMr�)rEr4r�)rrIr�s`  r�%test_generator_doesnt_retain_old_exc2z4ExceptionTests.test_generator_doesnt_retain_old_exc2us����	�	�	�	�	��a�c�c��	+�����	+�	+�	+����T�#�Y�Y��*�*�*�*�*�	+��������c���A�&�&�&�&�&s��-A	�A	c���d�}|�t��5|��}	ddzn%#t|��t|��YnxYwddd��dS#1swxYwYdS)Nc3�K�dV��r�r r rrrIz1ExceptionTests.test_raise_in_generator.<locals>.g�s�����G�G�G�rrMr)r[rYr�)rrIrvs   r�test_raise_in_generatorz&ExceptionTests.test_raise_in_generator�s���	�	�	�
�
�
�0�
1�
1�	�	�����A�
��!�����
��Q�����Q���������
	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s%�A"�0�A"� A�A"�"A&�)A&Fz Won't work if __debug__ is Falsec���ta	b|�d��dS#t$rJ}b|�|t��|�t
|��d��Yd}~dSd}~wwxYw)Nr��hello)rW�AssertionErrorrhr�r%r4r3rs  r�test_assert_shadowingz$ExceptionTests.test_assert_shadowing�s���
#��	,���I�I�*�+�+�+�+�+��
�	.�	.�	.���!�!�!�^�4�4�4����S��V�V�W�-�-�-�-�-�-�-�-�-�����	.���s�
A5�?A0�0A5c��Gd�dt��}	t�#t$r}|}Yd}~nd}~wwxYw	|�#t$rYnwxYwtd��D]/}	t�#t$r
}Yd}~nd}~wwxYwt���0dS)Nc��eZdZdS)�BExceptionTests.test_memory_error_subclasses.<locals>.TestExceptionNr�r rr�
TestExceptionr��r�rr�rF)rJr)rfr)rr�r/�inst�_s     r�test_memory_error_subclassesz+ExceptionTests.test_memory_error_subclasses�s���	�	�	�	�	�K�	�	�	�	�����	�	�	��D�D�D�D�D�D�����	����	�����	�	�	��D�	�����r���	�	�A�
�!�!���
�
�
����������
����
�L�L�L�L�
	�	s1��
2�-�2�8�
A�A�A!�!
A5�0A5)NNr>)Lrrrr8ror{rr�r�r�rr�r��unittest�
skipUnlessr]r�r�rrr'r+r1r3r8r;rBrrJrMrTrVrwr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��skipr�r�rrrr
rrr#r-r/r?rBrLr[rcrhrmrxr}r�r�r�r�r�r�r rrr-r-&s������4�4�4�RC�RC�RC�h?�?�?�.'Q�'Q�'Q�R7�7�7�7�"2�2�2�a)�a)�a)�F�-�-��\�-�^%0�%0�%0�N�X�����0�3�5�5�;�;�5�5�;�B@�B@�B@�H2�2�2�6.�.�.�*-�-�-�J�J�J�	0�	0�	0�'�'�'� 1�1�1�$*�*�*��
-�
-��Z�
-�2�2�2�	�	�	�	�	�	�w�w�w�r���;�;�;�<
=�
=�
=�=�=�=�&=�=�=�6
3�
3�
3�=�=�=����2:�:�:�:�:�:�
8�8�8�
9�9�9�9�9�9�
0�
0�
0�&)�&)�&)�PD�D�D�&�X�]�$�%�%�"(�"(�&�%�"(�H-(�-(�-(�^+�+�+�7�7�7�$+�+�+�$#i�#i�#i�J<�<�<��B�B��Z�B�>����\���8%�8%��\�8%�t�%�%��\�%�$,2�,2�,2�^�/�/��\�/�*�#�#��\�#�$�%-�%-��\�%-�N�%�%��\�%�,�%�%��Z�%�(J�J�J�>�>�>� 7�7�7�*�/�/��\�/� #�#�#�.'�'�'�$
�
�
��X���$F�G�G�
,�
,�H�G�
,�����rr-c�P�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS)
�NameErrorTestsc�|�	tdS#t$r&}|�d|j��Yd}~dSd}~wwxYw)N�bluch)r�rKr4�namerrs  r�test_name_error_has_namez'NameErrorTests.test_name_error_has_name�sY��	0��E�E�E���	0�	0�	0����W�c�h�/�/�/�/�/�/�/�/�/�����	0���s��
;�6�;c��d�}d�}d�}d�}d�}d�}|df|df|d	f|d
f|df|dffD]�\}}d}		|��na#t$rT}
tj��5}	tjtj���ddd��n#1swxYwYYd}
~
nd}
~
wwxYw|�||	�������dS)Nc�B�dx}x}x}}d}tt��dSr�rr�)�noise�
more_noiser��bc�blechs     r�Substitutionz@NameErrorTests.test_name_error_suggestions.<locals>.Substitution�s*��*.�.�E�.�J�.��R��E��%�L�L�L�L�Lrc�B�dx}x}x}}d}tt��dSrr�)r�r�r�r��blchs     r�Eliminationz?NameErrorTests.test_name_error_suggestions.<locals>.Elimination�s*��*.�.�E�.�J�.��R��D��%�L�L�L�L�Lrc�B�dx}x}x}}d}tt��dSrr�)r�r�r�r��bluchins     r�Additionz<NameErrorTests.test_name_error_suggestions.<locals>.Addition�s*��*.�.�E�.�J�.��R��G��%�L�L�L�L�Lrc�6�d}d}tt��dSrr�)�blach�blucs  r�SubstitutionOverEliminationzONameErrorTests.test_name_error_suggestions.<locals>.SubstitutionOverElimination�s���E��D��%�L�L�L�L�Lrc�6�d}d}tt��dSrr�)r��bluchis  r�SubstitutionOverAdditionzLNameErrorTests.test_name_error_suggestions.<locals>.SubstitutionOverAddition�s���E��F��%�L�L�L�L�Lrc�6�d}d}tt��dSrr�)�bluchar�s  r�EliminationOverAdditionzKNameErrorTests.test_name_error_suggestions.<locals>.EliminationOverAddition�s���F��D��%�L�L�L�L�Lr�'blech'?�'blch'?�
'bluchin'?z	'blucha'?�'blach'?�rKrrr]rzr�r�r{)rr�r�r�r�r�r�r<�
suggestionr5r/s           r�test_name_error_suggestionsz*NameErrorTests.test_name_error_suggestions�s���	�	�	�
	�	�	�
	�	�	�
	�	�	�
	�	�	�
	�	�	�
#/�
�!;�!,�i� 8�!)�<� 8�!8�+� F�!<�j� I�!9�:� F�!H�	6�	6��D�*��C�
8���������
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
�M�M�*�c�l�l�n�n�5�5�5�5�	6�	6s9�
:�
B�B� B�7B�B�B�
B�B�Bc�6�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc�.�tt��dSr)r�global_for_suggestior rrr<zENameErrorTests.test_name_error_suggestions_from_globals.<locals>.func�s���&�'�'�'�'�'rz'global_for_suggestions'?r��rr<r/r5s    r�(test_name_error_suggestions_from_globalsz7NameErrorTests.test_name_error_suggestions_from_globals�s���	(�	(�	(�	4��D�F�F�F�F���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
�
�
�1�3�<�<�>�>�B�B�B�B�B�7�
�
A.�A)� A�
A)�A	�A)� A	�!A)�)A.c�6�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc�.�tt��dSr)r�ZeroDivisionErrrrrr rrr<zFNameErrorTests.test_name_error_suggestions_from_builtins.<locals>.funcs���$�%�%�%�%�%rz'ZeroDivisionError'?r�r�s    r�)test_name_error_suggestions_from_builtinsz8NameErrorTests.test_name_error_suggestions_from_builtinss���	&�	&�	&�	4��D�F�F�F�F���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
�
�
�,�c�l�l�n�n�=�=�=�=�=r�c�6�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc�2�d}tt��dSr)r�somethingverywronghe)�somethingverywronghehehehehehes rrEzSNameErrorTests.test_name_error_suggestions_do_not_trigger_for_long_names.<locals>.fs��-1�*��&�'�'�'�'�'r�somethingverywronghehe�rKrrr]rzr�rQr{�rrEr/r5s    r�9test_name_error_suggestions_do_not_trigger_for_long_nameszHNameErrorTests.test_name_error_suggestions_do_not_trigger_for_long_namess���	(�	(�	(�	4�
�A�C�C�C�C���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
���1�3�<�<�>�>�B�B�B�B�Br�c�\�dx}x}x}x}}|�d���5	tna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����ddd��n#1swxYwY|�d	���5	tna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����ddd��n#1swxYwY|�d
���5	tna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����ddd��n#1swxYwY|�d���5	tna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d|�	����ddd��dS#1swxYwYdS)NrL�r��you mean�vvv�mom�'id'�'w'�'pytho'r�m�py)
r2rLrKrrr]rzr�rQr{rr�r�)rr�r�r=�id�pythor/r5s        r�>test_name_error_bad_suggestions_do_not_trigger_for_small_nameszMNameErrorTests.test_name_error_bad_suggestions_do_not_trigger_for_small_namess@��%)�)��)�c�)�A�)��U�
�\�\�s�\�
#�
#�	8�	8�
8������
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�s�\�
#�
#�	8�	8�
8������
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�s�\�
#�
#�	8�	8�
8������
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�t�\�
$�
$�	8�	8�
8������
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8s~�F�+�F�
B	�B� A4�(B�4A8�8B�;A8�<B�?F�B	�	C3F�F�F�)L�+F3�2L�3
H�=H� G<�0H�<H�H�H�H�L�H�C3L�L�L�1R�3L;�:R�;
N�N� N�8N�N�N�N�N�R�N�C3R�R�R�9X!�;S�X!�
T!�
T�  T�T�T�T�T�T�X!�T!�!C3X!�!X%�(X%c�6�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�|���d��dS)Nc���dx}x}x}x}x}x}x}x}x}x}	x}
x}x}x}
x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x} x}!x}"x}#x}$x}%x}&x}'x}(x})x}*x}+x},x}-x}.x}/x}0x}1x}2x}3x}4x}5x}6x}7x}8x}9x}:x};x}<x}=x}>x}?x}@x}Ax}Bx}Cx}Dx}Ex}Fx}Gx}Hx}Ix}Jx}Kx}Lx}Mx}Nx}Ox}Px}Qx}Rx}Sx}Tx}Ux}Vx}Wx}Xx}Yx}Zx}[x}\x}]x}^x}_x}`x}ax}bx}cx}dx}ex}fx}gx}hx}ix}jx}kx}lx}mx}nx}ox}px}qx}rx}sx}tx}ux}vx}wx}xx}yx}zx}{x}|x}}x}~x}x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x}�x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}	x�}
x�}x�}x�}
x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�} x�}!x�}"x�}#x�}$x�}%x�}&x�}'x�}(x�})x�}*x�}+x�},x�}-x�}.x�}/x�}0x�}1x�}2x�}3x�}4x�}5x�}6x�}7x�}8x�}9x�}:x�};x�}<x�}=x�}>x�}?x�}@x�}Ax�}Bx�}Cx�}Dx�}Ex�}Fx�}Gx�}Hx�}Ix�}Jx�}Kx�}Lx�}Mx�}Nx�}Ox�}Px�}Qx�}Rx�}Sx�}Tx�}Ux�}Vx�}Wx�}Xx�}Yx�}Zx�}[x�}\x�}]x�}^x�}_x�}`x�}ax�}bx�}cx�}dx�}ex�}fx�}gx�}hx�}ix�}jx�}kx�}lx�}mx�}nx�}ox�}px�}qx�}rx�}sx�}tx�}ux�}vx�}wx�}xx�}yx�}zx�}{x�}|x�}}x�}~x�}x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}	x�}
x�}x�}x�}
x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�} x�}!x�}"x�}#x�}$x�}%x�}&x�}'x�}(x�})x�}*x�}+x�},x�}-x�}.x�}/x�}0x�}1x�}2x�}3x�}4x�}5x�}6x�}7x�}8x�}9x�}:x�};x�}<x�}=x�}>x�}?x�}@x�}Ax�}Bx�}Cx�}Dx�}Ex�}Fx�}Gx�}Hx�}Ix�}Jx�}Kx�}Lx�}Mx�}Nx�}Ox�}Px�}Qx�}Rx�}Sx�}Tx�}Ux�}Vx�}Wx�}Xx�}Yx�}Zx�}[x�}\x�}]x�}^x�}_x�}`x�}ax�}bx�}cx�}dx�}ex�}fx�}gx�}hx�}ix�}jx�}kx�}lx�}mx�}nx�}ox�}px�}qx�}rx�}sx�}tx�}ux�}vx�}wx�}xx�}yx�}zx�}{x�}|x�}}x�}~x�}x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}�x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}	x�}
x�}x�}x�}
x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}x�}�}tt��dSr)r�a0( �a1�a2�a3�a4�a5�a6�a7�a8�a9�a10�a11�a12�a13�a14�a15�a16�a17�a18�a19�a20�a21�a22�a23�a24�a25�a26�a27�a28�a29�a30�a31�a32�a33�a34�a35�a36�a37�a38�a39�a40�a41�a42�a43�a44�a45�a46�a47�a48�a49�a50�a51�a52�a53�a54�a55�a56�a57�a58�a59�a60�a61�a62�a63�a64�a65�a66�a67�a68�a69�a70�a71�a72�a73�a74�a75�a76�a77�a78�a79�a80�a81�a82�a83�a84�a85�a86�a87�a88�a89�a90�a91�a92�a93�a94�a95�a96�a97�a98�a99�a100�a101�a102�a103�a104�a105�a106�a107�a108�a109�a110�a111�a112�a113�a114�a115�a116�a117�a118�a119�a120�a121�a122�a123�a124�a125�a126�a127�a128�a129�a130�a131�a132�a133�a134�a135�a136�a137�a138�a139�a140�a141�a142�a143�a144�a145�a146�a147�a148�a149�a150�a151�a152�a153�a154�a155�a156�a157�a158�a159�a160�a161�a162�a163�a164�a165�a166�a167�a168�a169�a170�a171�a172�a173�a174�a175�a176�a177�a178�a179�a180�a181�a182�a183�a184�a185�a186�a187�a188�a189�a190�a191�a192�a193�a194�a195�a196�a197�a198�a199�a200�a201�a202�a203�a204�a205�a206�a207�a208�a209�a210�a211�a212�a213�a214�a215�a216�a217�a218�a219�a220�a221�a222�a223�a224�a225�a226�a227�a228�a229�a230�a231�a232�a233�a234�a235�a236�a237�a238�a239�a240�a241�a242�a243�a244�a245�a246�a247�a248�a249�a250�a251�a252�a253�a254�a255�a256�a257�a258�a259�a260�a261�a262�a263�a264�a265�a266�a267�a268�a269�a270�a271�a272�a273�a274�a275�a276�a277�a278�a279�a280�a281�a282�a283�a284�a285�a286�a287�a288�a289�a290�a291�a292�a293�a294�a295�a296�a297�a298�a299�a300�a301�a302�a303�a304�a305�a306�a307�a308�a309�a310�a311�a312�a313�a314�a315�a316�a317�a318�a319�a320�a321�a322�a323�a324�a325�a326�a327�a328�a329�a330�a331�a332�a333�a334�a335�a336�a337�a338�a339�a340�a341�a342�a343�a344�a345�a346�a347�a348�a349�a350�a351�a352�a353�a354�a355�a356�a357�a358�a359�a360�a361�a362�a363�a364�a365�a366�a367�a368�a369�a370�a371�a372�a373�a374�a375�a376�a377�a378�a379�a380�a381�a382�a383�a384�a385�a386�a387�a388�a389�a390�a391�a392�a393�a394�a395�a396�a397�a398�a399�a400�a401�a402�a403�a404�a405�a406�a407�a408�a409�a410�a411�a412�a413�a414�a415�a416�a417�a418�a419�a420�a421�a422�a423�a424�a425�a426�a427�a428�a429�a430�a431�a432�a433�a434�a435�a436�a437�a438�a439�a440�a441�a442�a443�a444�a445�a446�a447�a448�a449�a450�a451�a452�a453�a454�a455�a456�a457�a458�a459�a460�a461�a462�a463�a464�a465�a466�a467�a468�a469�a470�a471�a472�a473�a474�a475�a476�a477�a478�a479�a480�a481�a482�a483�a484�a485�a486�a487�a488�a489�a490�a491�a492�a493�a494�a495�a496�a497�a498�a499�a500�a501�a502�a503�a504�a505�a506�a507�a508�a509�a510�a511�a512�a513�a514�a515�a516�a517�a518�a519�a520�a521�a522�a523�a524�a525�a526�a527�a528�a529�a530�a531�a532�a533�a534�a535�a536�a537�a538�a539�a540�a541�a542�a543�a544�a545�a546�a547�a548�a549�a550�a551�a552�a553�a554�a555�a556�a557�a558�a559�a560�a561�a562�a563�a564�a565�a566�a567�a568�a569�a570�a571�a572�a573�a574�a575�a576�a577�a578�a579�a580�a581�a582�a583�a584�a585�a586�a587�a588�a589�a590�a591�a592�a593�a594�a595�a596�a597�a598�a599�a600�a601�a602�a603�a604�a605�a606�a607�a608�a609�a610�a611�a612�a613�a614�a615�a616�a617�a618�a619�a620�a621�a622�a623�a624�a625�a626�a627�a628�a629�a630�a631�a632�a633�a634�a635�a636�a637�a638�a639�a640�a641�a642�a643�a644�a645�a646�a647�a648�a649�a650�a651�a652�a653�a654�a655�a656�a657�a658�a659�a660�a661�a662�a663�a664�a665�a666�a667�a668�a669�a670�a671�a672�a673�a674�a675�a676�a677�a678�a679�a680�a681�a682�a683�a684�a685�a686�a687�a688�a689�a690�a691�a692�a693�a694�a695�a696�a697�a698�a699�a700�a701�a702�a703�a704�a705�a706�a707�a708�a709�a710�a711�a712�a713�a714�a715�a716�a717�a718�a719�a720�a721�a722�a723�a724�a725�a726�a727�a728�a729�a730�a731�a732�a733�a734�a735�a736�a737�a738�a739�a740�a741�a742�a743�a744�a745�a746�a747�a748�a749�a750�a751�a752�a753�a754�a755�a756�a757�a758�a759�a760�a761�a762�a763�a764�a765�a766�a767�a768�a769�a770�a771�a772�a773�a774�a775�a776�a777�a778�a779�a780�a781�a782�a783�a784�a785�a786�a787�a788�a789�a790�a791�a792�a793�a794�a795�a796�a797�a798�a799�a800s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 rrEzXNameErrorTests.test_name_error_suggestions_do_not_trigger_for_too_many_locals.<locals>.fSsW'��d�aP
�B�P
��P
�b�P
�2�P
��P
�R�P
�"�P
�r�P
�B�P
��P
��P
��P
��P
�!�P
�$'�P
�*-�P
�03�P
�69�P
�<?�P
�BE�P
��P
��P
��P
�!�P
�$'�P
�*-�P
�03�P
�69�P
�<?�P
�BE�P
�
�P
��P
��P
�"�P
�%(�P
�+.�P
�14�P
�7:�P
�=@�P
�CF�P
�
�	P
��	P
��	P
�"�	P
�%(�	P
�+.�	P
�14�	P
�7:�	P
�=@�	P
�CF�	P
�

�P
�
�P
�
�P
�
"�P
�
%(�P
�
+.�P
�
14�P
�
7:�P
�
=@�P
�
CF�P
�
�
P
��
P
��
P
�"�
P
�%(�
P
�+.�
P
�14�
P
�7:�
P
�=@�
P
�CF�
P
�
�P
��P
��P
�"�P
�%(�P
�+.�P
�14�P
�7:�P
�=@�P
�CF�P
�
�P
��P
��P
�"�P
�%(�P
�+.�P
�14�P
�7:�P
�=@�P
�CF�P
�
�P
��P
��P
�"�P
�%(�P
�+.�P
�14�P
�7:�P
�=@�P
�CG�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
�
�P
��P
��P
�"&�P
�)-�P
�04�P
�7;�P
�>B�P
�EI�P
�LP�P
� 
�!P
� �!P
� �!P
� "&�!P
� )-�!P
� 04�!P
� 7;�!P
� >B�!P
� EI�!P
� LP�!P
�"
�#P
�"�#P
�"�#P
�""&�#P
�")-�#P
�"04�#P
�"7;�#P
�">B�#P
�"EI�#P
�"LP�#P
�$
�%P
�$�%P
�$�%P
�$"&�%P
�$)-�%P
�$04�%P
�$7;�%P
�$>B�%P
�$EI�%P
�$LP�%P
�&
�'P
�&�'P
�&�'P
�&"&�'P
�&)-�'P
�&04�'P
�&7;�'P
�&>B�'P
�&EI�'P
�&LP�'P
�(
�)P
�(�)P
�(�)P
�("&�)P
�()-�)P
�(04�)P
�(7;�)P
�(>B�)P
�(EI�)P
�(LP�)P
�*
�+P
�*�+P
�*�+P
�*"&�+P
�*)-�+P
�*04�+P
�*7;�+P
�*>B�+P
�*EI�+P
�*LP�+P
�,
�-P
�,�-P
�,�-P
�,"&�-P
�,)-�-P
�,04�-P
�,7;�-P
�,>B�-P
�,EI�-P
�,LP�-P
�.
�/P
�.�/P
�.�/P
�."&�/P
�.)-�/P
�.04�/P
�.7;�/P
�.>B�/P
�.EI�/P
�.LP�/P
�0
�1P
�0�1P
�0�1P
�0"&�1P
�0)-�1P
�004�1P
�07;�1P
�0>B�1P
�0EI�1P
�0LP�1P
�2
�3P
�2�3P
�2�3P
�2"&�3P
�2)-�3P
�204�3P
�27;�3P
�2>B�3P
�2EI�3P
�2LP�3P
�4
�5P
�4�5P
�4�5P
�4"&�5P
�4)-�5P
�404�5P
�47;�5P
�4>B�5P
�4EI�5P
�4LP�5P
�6
�7P
�6�7P
�6�7P
�6"&�7P
�6)-�7P
�604�7P
�67;�7P
�6>B�7P
�6EI�7P
�6LP�7P
�8
�9P
�8�9P
�8�9P
�8"&�9P
�8)-�9P
�804�9P
�87;�9P
�8>B�9P
�8EI�9P
�8LP�9P
�:
�;P
�:�;P
�:�;P
�:"&�;P
�:)-�;P
�:04�;P
�:7;�;P
�:>B�;P
�:EI�;P
�:LP�;P
�<
�=P
�<�=P
�<�=P
�<"&�=P
�<)-�=P
�<04�=P
�<7;�=P
�<>B�=P
�<EI�=P
�<LP�=P
�>
�?P
�>�?P
�>�?P
�>"&�?P
�>)-�?P
�>04�?P
�>7;�?P
�>>B�?P
�>EI�?P
�>LP�?P
�@
�AP
�@�AP
�@�AP
�@"&�AP
�@)-�AP
�@04�AP
�@7;�AP
�@>B�AP
�@EI�AP
�@LP�AP
�B
�CP
�B�CP
�B�CP
�B"&�CP
�B)-�CP
�B04�CP
�B7;�CP
�B>B�CP
�BEI�CP
�BLP�CP
�D
�EP
�D�EP
�D�EP
�D"&�EP
�D)-�EP
�D04�EP
�D7;�EP
�D>B�EP
�DEI�EP
�DLP�EP
�F
�GP
�F�GP
�F�GP
�F"&�GP
�F)-�GP
�F04�GP
�F7;�GP
�F>B�GP
�FEI�GP
�FLP�GP
�H
�IP
�H�IP
�H�IP
�H"&�IP
�H)-�IP
�H04�IP
�H7;�IP
�H>B�IP
�HEI�IP
�HLP�IP
�J
�KP
�J�KP
�J�KP
�J"&�KP
�J)-�KP
�J04�KP
�J7;�KP
�J>B�KP
�JEI�KP
�JLP�KP
�L
�MP
�L�MP
�L�MP
�L"&�MP
�L)-�MP
�L04�MP
�L7;�MP
�L>B�MP
�LEI�MP
�LLP�MP
�N
�OP
�N�OP
�N�OP
�N"&�OP
�N)-�OP
�N04�OP
�N7;�OP
�N>B�OP
�NEI�OP
�NLP�OP
�P
�QP
�P�QP
�P�QP
�P"&�QP
�P)-�QP
�P04�QP
�P7;�QP
�P>B�QP
�PEI�QP
�PLP�QP
�R
�SP
�R�SP
�R�SP
�R"&�SP
�R)-�SP
�R04�SP
�R7;�SP
�R>B�SP
�REI�SP
�RLP�SP
�T
�UP
�T�UP
�T�UP
�T"&�UP
�T)-�UP
�T04�UP
�T7;�UP
�T>B�UP
�TEI�UP
�TLP�UP
�V
�WP
�V�WP
�V�WP
�V"&�WP
�V)-�WP
�V04�WP
�V7;�WP
�V>B�WP
�VEI�WP
�VLP�WP
�X
�YP
�X�YP
�X�YP
�X"&�YP
�X)-�YP
�X04�YP
�X7;�YP
�X>B�YP
�XEI�YP
�XLP�YP
�Z
�[P
�Z�[P
�Z�[P
�Z"&�[P
�Z)-�[P
�Z04�[P
�Z7;�[P
�Z>B�[P
�ZEI�[P
�ZLP�[P
�\
�]P
�\�]P
�\�]P
�\"&�]P
�\)-�]P
�\04�]P
�\7;�]P
�\>B�]P
�\EI�]P
�\LP�]P
�^
�_P
�^�_P
�^�_P
�^"&�_P
�^)-�_P
�^04�_P
�^7;�_P
�^>B�_P
�^EI�_P
�^LP�_P
�`
�aP
�`�aP
�`�aP
�`"&�aP
�`)-�aP
�`04�aP
�`7;�aP
�`>B�aP
�`EI�aP
�`LP�aP
�b
�cP
�b�cP
�b�cP
�b"&�cP
�b)-�cP
�b04�cP
�b7;�cP
�b>B�cP
�bEI�cP
�bLP�cP
�d
�eP
�d�eP
�d�eP
�d"&�eP
�d)-�eP
�d04�eP
�d7;�eP
�d>B�eP
�dEI�eP
�dLP�eP
�f
�gP
�f�gP
�f�gP
�f"&�gP
�f)-�gP
�f04�gP
�f7;�gP
�f>B�gP
�fEI�gP
�fLP�gP
�h
�iP
�h�iP
�h�iP
�h"&�iP
�h)-�iP
�h04�iP
�h7;�iP
�h>B�iP
�hEI�iP
�hLP�iP
�j
�kP
�j�kP
�j�kP
�j"&�kP
�j)-�kP
�j04�kP
�j7;�kP
�j>B�kP
�jEI�kP
�jLP�kP
�l
�mP
�l�mP
�l�mP
�l"&�mP
�l)-�mP
�l04�mP
�l7;�mP
�l>B�mP
�lEI�mP
�lLP�mP
�n
�oP
�n�oP
�n�oP
�n"&�oP
�n)-�oP
�n04�oP
�n7;�oP
�n>B�oP
�nEI�oP
�nLP�oP
�p
�qP
�p�qP
�p�qP
�p"&�qP
�p)-�qP
�p04�qP
�p7;�qP
�p>B�qP
�pEI�qP
�pLP�qP
�r
�sP
�r�sP
�r�sP
�r"&�sP
�r)-�sP
�r04�sP
�r7;�sP
�r>B�sP
�rEI�sP
�rLP�sP
�t
�uP
�t�uP
�t�uP
�t"&�uP
�t)-�uP
�t04�uP
�t7;�uP
�t>B�uP
�tEI�uP
�tLP�uP
�v
�wP
�v�wP
�v�wP
�v"&�wP
�v)-�wP
�v04�wP
�v7;�wP
�v>B�wP
�vEI�wP
�vLP�wP
�x
�yP
�x�yP
�x�yP
�x"&�yP
�x)-�yP
�x04�yP
�x7;�yP
�x>B�yP
�xEI�yP
�xLP�yP
�z
�{P
�z�{P
�z�{P
�z"&�{P
�z)-�{P
�z04�{P
�z7;�{P
�z>B�{P
�zEI�{P
�zLP�{P
�|
�}P
�|�}P
�|�}P
�|"&�}P
�|)-�}P
�|04�}P
�|7;�}P
�|>B�}P
�|EI�}P
�|LP�}P
�~
�P
�~�P
�~�P
�~"&�P
�~)-�P
�~04�P
�~7;�P
�~>B�P
�~EI�P
�~LP�P
�@
�AP
�@�AP
�@�AP
�@"&�AP
�@)-�AP
�@04�AP
�@7;�AP
�@>B�AP
�@EI�AP
�@LP�AP
�B
�CP
�B�CP
�B�CP
�B"&�CP
�B)-�CP
�B04�CP
�B7;�CP
�B>B�CP
�BEI�CP
�BLP�CP
�D
�EP
�D�EP
�D�EP
�D"&�EP
�D)-�EP
�D04�EP
�D7;�EP
�D>B�EP
�DEI�EP
�DLP�EP
�F
�GP
�F�GP
�F�GP
�F"&�GP
�F)-�GP
�F04�GP
�F7;�GP
�F>B�GP
�FEI�GP
�FLP�GP
�H
�IP
�H�IP
�H�IP
�H"&�IP
�H)-�IP
�H04�IP
�H7;�IP
�H>B�IP
�HEI�IP
�HLP�IP
�J
�KP
�J�KP
�J�KP
�J"&�KP
�J)-�KP
�J04�KP
�J7;�KP
�J>B�KP
�JEI�KP
�JLP�KP
�L
�MP
�L�MP
�L�MP
�L"&�MP
�L)-�MP
�L04�MP
�L7;�MP
�L>B�MP
�LEI�MP
�LLP�MP
�N
�OP
�N�OP
�N�OP
�N"&�OP
�N)-�OP
�N04�OP
�N7;�OP
�N>B�OP
�NEI�OP
�NLP�OP
�P
�QP
�P�QP
�P�QP
�P"&�QP
�P)-�QP
�P04�QP
�P7;�QP
�P>B�QP
�PEI�QP
�PLP�QP
�R
�SP
�R�SP
�R�SP
�R"&�SP
�R)-�SP
�R04�SP
�R7;�SP
�R>B�SP
�REI�SP
�RLP�SP
�T
�UP
�T�UP
�T�UP
�T"&�UP
�T)-�UP
�T04�UP
�T7;�UP
�T>B�UP
�TEI�UP
�TLP�UP
�V
�WP
�V�WP
�V�WP
�V"&�WP
�V)-�WP
�V04�WP
�V7;�WP
�V>B�WP
�VEI�WP
�VLP�WP
�X
�YP
�X�YP
�X�YP
�X"&�YP
�X)-�YP
�X04�YP
�X7;�YP
�X>B�YP
�XEI�YP
�XLP�YP
�Z
�[P
�Z�[P
�Z�[P
�Z"&�[P
�Z)-�[P
�Z04�[P
�Z7;�[P
�Z>B�[P
�ZEI�[P
�ZLP�[P
�\
�]P
�\�]P
�\�]P
�\"&�]P
�\)-�]P
�\04�]P
�\7;�]P
�\>B�]P
�\EI�]P
�\LP�]P
�^
�_P
�^�_P
�^�_P
�^"&�_P
�^)-�_P
�^04�_P
�^7;�_P
�^>B�_P
�^EI�4��"�I�I�I�I�Irz
NameError.*a1)rKrrr]rzr��assertNotRegexr{r�s    r�>test_name_error_suggestions_do_not_trigger_for_too_many_localszMNameErrorTests.test_name_error_suggestions_do_not_trigger_for_too_many_localsRs���S	�S	�S	�j	4�
�A�C�C�C�C���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
���C�L�L�N�N�,<�=�=�=�=�=r�c�f�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc�"�d}t���r�rK�r�s rrEz@NameErrorTests.test_name_error_with_custom_exceptions.<locals>.f�s���E��+�+�rr�c��d}t�rrrs rrEz@NameErrorTests.test_name_error_with_custom_exceptions.<locals>.f�s���E��Orr�r�s    r�&test_name_error_with_custom_exceptionsz5NameErrorTests.test_name_error_with_custom_exceptions�s���	�	�	�	4�
�A�C�C�C�C���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����#�,�,�.�.�1�1�1�	�	�	�	4�
�A�C�C�C�C���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����#�,�,�.�.�1�1�1�1�1ss�
�
A.�A)� A�
A)�A	�A)� A	�!A)�)A.�
B(�(
D�2D� C1�%D�1C5	�5D�8C5	�9D�Dc�6�d�}	|��na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc�,�d}t|��d}dS)Nr�)r)r{�	somethongs  rr�zDNameErrorTests.test_unbound_local_error_doesn_not_match.<locals>.foo�s���I��)�����I�I�Irr{)rSrrr]rzr�rQr{)rr�r/r5s    r�(test_unbound_local_error_doesn_not_matchz7NameErrorTests.test_unbound_local_error_doesn_not_match�s���	�	�	�
	4��C�E�E�E�E�� �	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����c�l�l�n�n�5�5�5�5�5r�c�.���fd�}	|��nZ#�j$rMtj��5}tjtj���ddd��n#1swxYwYYnwxYw��d|�����dS)Nc�~����td��5tddd��dS#1swxYwYdS)N�aaa)r�rK�aabr*s�rrEz)NameErrorTests.test_issue45826.<locals>.f�s�����'�'�	�5�9�9�
�
���
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s�2�6�6r)�failureExceptionrrr]rzr�r�r{�rrEr5s`  r�test_issue45826zNameErrorTests.test_issue45826�s����	�	�	�	�	�	4�
�A�C�C�C�C���$�	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4���	4����	
�
�
�e�S�\�\�^�^�,�,�,�,�,s2�
�A*� A�A*�A 	� A*�#A 	�$A*�)A*c�x�d�}	|��nZ#t$rMtj��5}tjtj���ddd��n#1swxYwYYnwxYw|�d|�����|�d|�����dS)Nc��	tdS#t$r(}|�d��t���d}~wwxYwr)�nonsenser�r$rY)r�s rrEz1NameErrorTests.test_issue45826_focused.<locals>.f�sO��
*������ �
*�
*�
*�� � ��&�&�&�'�)�)�)�����
*���s��
=�#8�=rrY)rYrrr]rzr�r�r{rs   r�test_issue45826_focusedz&NameErrorTests.test_issue45826_focused�s���	*�	*�	*�	4�
�A�C�C�C�C�� �	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4���	4����	
�
�
�j�#�,�,�.�.�1�1�1��
�
�)�3�<�<�>�>�:�:�:�:�:s2�
�A'� A�
A'�A	�A'� A	�!A'�&A'N)rrrr�r�r�r�r�r�rrrrrr rrr�r��s�������0�0�0�+6�+6�+6�ZC�C�C�>�>�>�C�C�C�58�58�58�n\>�\>�\>�|2�2�2�26�6�6�-�-�-�;�;�;�;�;rr�c�\�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�ZdS)�AttributeErrorTestsc�8�td��}|�|j��|�|j��t	��}tdd|���}|�|jd��|�|j|��dS)NzOuch!�Ouch�carry�r�r\)r:r7r�r\r�r4r�)rr/�sentinels   r�test_attributesz#AttributeErrorTests.test_attributes�s����W�%�%�����#�(�#�#�#����#�'�"�"�"��8�8���V�'�x�@�@�@�������7�+�+�+��
�
�c�g�x�(�(�(�(�(rc��Gd�d��}|��}	|jnM#t$r@}|�d|j��|�||j��Yd}~nd}~wwxYw	t
�|d��dS#t$rA}|�d|j��|�||j��Yd}~dSd}~wwxYw)Nc��eZdZdZdS)�<AttributeErrorTests.test_getattr_has_name_and_obj.<locals>.AN�rrrr�r rrr�r(��������E�E�Err�r�)r�r:r4r�r\r��__getattribute__�rr�r\r/s    r�test_getattr_has_name_and_objz1AttributeErrorTests.test_getattr_has_name_and_objs%��	�	�	�	�	�	�	�	��a�c�c��	+��I�I�I���	+�	+�	+����W�c�h�/�/�/����S�#�'�*�*�*�*�*�*�*�*�����	+����	+��#�#�C��1�1�1�1�1���	+�	+�	+����W�c�h�/�/�/����S�#�'�*�*�*�*�*�*�*�*�*�����	+���s,�!�
A+�6A&�&A+�/B�
C�6C�Cc��Gd�d��}|��}	|���dS#t$rA}|�d|j��|�||j��Yd}~dSd}~wwxYw)Nc��eZdZd�ZdS)�GAttributeErrorTests.test_getattr_has_name_and_obj_for_method.<locals>.Ac��dSrr r*s rr�zMAttributeErrorTests.test_getattr_has_name_and_obj_for_method.<locals>.A.blechs���rNr)r rrr�r0s#������
�
�
�
�
rr�r�)r�r:r4r�r\r,s    r�(test_getattr_has_name_and_obj_for_methodz<AttributeErrorTests.test_getattr_has_name_and_obj_for_methods���	�	�	�	�	�	�	�	��a�c�c��	+��I�I�K�K�K�K�K���	+�	+�	+����W�c�h�/�/�/����S�#�'�*�*�*�*�*�*�*�*�*�����	+���s�/�
A:�6A5�5A:c�
�Gd�d��}Gd�d��}Gd�d��}Gd�d��}Gd	�d
��}Gd�d��}|d
f|df|df|df|df|dffD]�\}}	|��jna#t$rT}	tj��5}
t	jt	j���ddd��n#1swxYwYYd}	~	nd}	~	wwxYw|�||
�������dS)Nc�"�eZdZdxZxZxZZdZdS)�BAttributeErrorTests.test_getattr_suggestions.<locals>.SubstitutionN)rrrr�r�r�r�r�r rrr�r5 s'������*.�.�E�.�J�.��R��E�E�Err�c�"�eZdZdxZxZxZZdZdS)�AAttributeErrorTests.test_getattr_suggestions.<locals>.EliminationN)rrrr�r�r�r�r�r rrr�r7$s'������*.�.�E�.�J�.��R��D�D�Drr�c�"�eZdZdxZxZxZZdZdS)�>AttributeErrorTests.test_getattr_suggestions.<locals>.AdditionN)rrrr�r�r�r�r�r rrr�r9(s'������*.�.�E�.�J�.��R��G�G�Grr�c��eZdZdZdZdS)�QAttributeErrorTests.test_getattr_suggestions.<locals>.SubstitutionOverEliminationN)rrrr�r�r rrr�r;,s�������E��D�D�Drr�c��eZdZdZdZdS)�NAttributeErrorTests.test_getattr_suggestions.<locals>.SubstitutionOverAdditionN)rrrr�r�r rrr�r=0s�������E��F�F�Frr�c��eZdZdZdZdS)�MAttributeErrorTests.test_getattr_suggestions.<locals>.EliminationOverAdditionN)rrrr�r�r rrr�r?4s�������F��D�D�Drr�r�r�r�z'bluc'?r��	r�r:rrr]rzr�r�r{)rr�r�r�r�r�r�rr�r/r5s           r�test_getattr_suggestionsz,AttributeErrorTests.test_getattr_suggestionss��	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�".�z� :�!,�i� 8�!)�<� 8�!8�)� D�!<�j� I�!9�:� F� H�	6�	6�O�C��
8���������!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
�M�M�*�c�l�l�n�n�5�5�5�5�	6�	6s<�)A9�9
C�C� C�6C�C�C�	C�
C�Cc�T�Gd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc��eZdZdZdS)�ZAttributeErrorTests.test_getattr_suggestions_do_not_trigger_for_long_attributes.<locals>.ANr)r rrr�rDGr*rr�r�)	�somethingverywrongr:rrr]rzr�rQr{�rr�r/r5s    r�;test_getattr_suggestions_do_not_trigger_for_long_attributeszOAttributeErrorTests.test_getattr_suggestions_do_not_trigger_for_long_attributesFs��	�	�	�	�	�	�	�	�	4�
�A�C�C�"�"�"���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����#�,�,�.�.�1�1�1�1�1�7��
A=�A8� A(�A8�(A,	�,A8�/A,	�0A8�8A=c�b�Gd�d��}|�d���5	|jna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d	|�	����|�d
|�	����ddd��n#1swxYwY|�d���5	|j
na#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d	|�	����|�d
|�	����ddd��n#1swxYwY|�d���5	|jna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d	|�	����|�d
|�	����ddd��n#1swxYwY|�d
���5	|jna#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�	����|�d|�	����|�d|�	����|�d|�	����|�d	|�	����|�d
|�	����ddd��dS#1swxYwYdS)Nc�"�eZdZdxZxZxZxZZdS)�fAttributeErrorTests.test_getattr_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.MyClassN)rrrr�r�r=r�r�r rr�MyClassrKSs'������)-�-�C�-�#�-��-�B���rrLrLr�r�r�r�r�r�r�rr�r�)
r2rLr:rrr]rzr�rQr{rr�r�)rrLr/r5s    r�Atest_getattr_error_bad_suggestions_do_not_trigger_for_small_nameszUAttributeErrorTests.test_getattr_error_bad_suggestions_do_not_trigger_for_small_namesRsY��	.�	.�	.�	.�	.�	.�	.�	.��\�\�s�\�
#�
#�	8�	8�
8��	�	�	��!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�s�\�
#�
#�	8�	8�
8��	�	�	��!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�s�\�
#�
#�	8�	8�
8��	�	�	��!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��\�\�t�\�
$�
$�	8�	8�
8��
�
�
��!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
���Z������8�8�8����U�C�L�L�N�N�3�3�3����U�C�L�L�N�N�3�3�3����V�S�\�\�^�^�4�4�4����U�C�L�L�N�N�3�3�3����Y������7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8s~�F�.�F�
B�B� A7�+B�7A;�;B�>A;�?B�F�B�C3F�F�F�,L�.F6�5L�6
H�H� G?�3H�?H�H�H�H�
L�H�C3L�L�L�4R�6L>�=R�>
N�N� N�;N�N�N�N�N�R�N�C3R�R�"R�<X$�>S�X$�
T$�T�# T�T�T�T�T�T�X$�T$�$C3X$�$X(�+X(c��Gd�d��}td��D]}t|d|��d���	|��jna#t$rT}t	j��5}t
jt
j���ddd��n#1swxYwYYd}~nd}~wwxYw|�	d|�
����dS)Nc��eZdZdZdS)�TAttributeErrorTests.test_getattr_suggestions_do_not_trigger_for_big_dicts.<locals>.ANr)r rrr�rP�r*rr�i��index_r�)rfr/r�r:rrr]rzr�rQr{)rr��indexr/r5s     r�5test_getattr_suggestions_do_not_trigger_for_big_dictszIAttributeErrorTests.test_getattr_suggestions_do_not_trigger_for_big_dicts�s2��	�	�	�	�	�	�	�	��4�[�[�	/�	/�E��A�'��'�'��.�.�.�.�	4�
�A�C�C�I�I�I���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����#�,�,�.�.�1�1�1�1�1s;�A�
B#�B�" B�B�B	�B�B	�B�B#c��Gd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����Gd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc��eZdZdZd�ZdS)�?AttributeErrorTests.test_getattr_suggestions_no_args.<locals>.ANc��t���r�r:�r�attrs  r�__getattr__zKAttributeErrorTests.test_getattr_suggestions_no_args.<locals>.A.__getattr__�s��$�&�&�&r�rrrr�r[r rrr�rV�s(�������E�
'�
'�
'�
'�
'rr�r�c��eZdZdZd�ZdS)rVNc��t�rrXrYs  rr[zKAttributeErrorTests.test_getattr_suggestions_no_args.<locals>.A.__getattr__�s��$�$rr\r rrr�z?AttributeErrorTests.test_getattr_suggestions_no_args.<locals>.A�s(�������E�
%�
%�
%�
%�
%rr@rFs    r� test_getattr_suggestions_no_argsz4AttributeErrorTests.test_getattr_suggestions_no_args�s���	'�	'�	'�	'�	'�	'�	'�	'�
	4�
�A�C�C�I�I�I���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
�
�
�g�s�|�|�~�~�.�.�.�	%�	%�	%�	%�	%�	%�	%�	%�
	4�
�A�C�C�I�I�I���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
�
�
�g�s�|�|�~�~�.�.�.�.�.ss��
A=�A8� A(�A8�(A,	�,A8�/A,	�0A8�8A=�6C�
D$�D�# D�D�D	�D�D	�D�D$c���Gd�d���G�fd�d��}Gd�d��}Gd�d��}|||fD]�}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d	|�������dS)
Nc��eZdZdZdZdS)�TAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.NonStringifyClassN)rrrr+�__repr__r rr�NonStringifyClassrb�s�������G��H�H�Hrrdc���eZdZdZ�fd�ZdS)�DAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.ANc�2��t������rrX)rrZrds  �rr[zPAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.A.__getattr__�s���$�%6�%6�%8�%8�9�9�9rr\)rds�rr�rf�s3��������E�
:�
:�
:�
:�
:�
:�
:rr�c��eZdZdZd�ZdS)�DAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.BNc�"�tdd���)N�Error�rXrYs  rr[zPAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.B.__getattr__�s��$�W�b�1�1�1rr\r rrr�ri�s(�������E�
2�
2�
2�
2�
2rr�c��eZdZdZd�ZdS)�DAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.CNc� �td���)NrlrXrYs  rr[zPAttributeErrorTests.test_getattr_suggestions_invalid_args.<locals>.C.__getattr__�s��$�R�(�(�(rr\r rrr�rn�s(�������E�
)�
)�
)�
)�
)rr�r�r@)rr�r�r�rr/r5rds       @r�%test_getattr_suggestions_invalid_argsz9AttributeErrorTests.test_getattr_suggestions_invalid_args�s����	�	�	�	�	�	�	�	�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�
	2�	2�	2�	2�	2�	2�	2�	2�
	)�	)�	)�	)�	)�	)�	)�	)�
�q�!�9�	3�	3�C�
8���������!�
8�
8�
8��,�.�.�8�#��&�����7�7�8�8�8�8�8�8�8�8�8�8�8����8�8�8�8����������
8����
�M�M�'�3�<�<�>�>�2�2�2�2�	3�	3s<�A�
B.�B)�- B�
B)�B�B)� B�!B)�)B.c�T�Gd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)Nc��eZdZd�ZdS)�EAttributeErrorTests.test_getattr_suggestions_for_same_name.<locals>.Ac��dgS)Nr�r r*s rr!zMAttributeErrorTests.test_getattr_suggestions_for_same_name.<locals>.A.__dir__�s
���y� rN)rrrr!r rrr�rs�s#������
!�
!�
!�
!�
!rr��Did you mean)	r�r:rrr]rzr�rQr{rFs    r�&test_getattr_suggestions_for_same_namez:AttributeErrorTests.test_getattr_suggestions_for_same_name�s���	!�	!�	!�	!�	!�	!�	!�	!�	4�
�A�C�C�I�I�I���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
���������8�8�8�8�8rHc��Gd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����|�d|�����dS)Nc��eZdZdZd�ZdS)�EAttributeErrorTests.test_attribute_error_with_failing_dict.<locals>.TrMc� �td���)N�oh no!rXr*s rr!zMAttributeErrorTests.test_attribute_error_with_failing_dict.<locals>.T.__dir__�s��$�X�.�.�.rN)rrrr�r!r rr�Try�s(�������E�
/�
/�
/�
/�
/rr|r�r{)	�blichr:rrr]rzr�rQr{)rr|r/r5s    r�&test_attribute_error_with_failing_dictz:AttributeErrorTests.test_attribute_error_with_failing_dict�s��	/�	/�	/�	/�	/�	/�	/�	/�
	4�
�A�C�C�I�I�I���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����#�,�,�.�.�1�1�1�����3�<�<�>�>�2�2�2�2�2rHc�<�	tdd����#t$rT}tj��5}tjtj���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����dS)N�rlr#�?)r:rrr]rzr�rQr{)rr/r5s   r�"test_attribute_error_with_bad_namez6AttributeErrorTests.test_attribute_error_with_bad_name�s���	4� �b�b�1�1�1�1���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
����c�l�l�n�n�-�-�-�-�-s7��
A1�A,� A�A,�A 	� A,�#A 	�$A,�,A1c����Gd�d���G�fd�d��}	|��jna#t$rT}tj��5}t	jt	j���ddd��n#1swxYwYYd}~nd}~wwxYw|�d|�����|�d|�����dS)Nc��eZdZdZdS)�IAttributeErrorTests.test_attribute_error_inside_nested_getattr.<locals>.ArMN)rrrr�r rrr�r��s�������E�E�Err�c���eZdZ�fd�ZdS)�IAttributeErrorTests.test_attribute_error_inside_nested_getattr.<locals>.Bc�&�����}|jSr)r})rrZr�r�s   �rr+zZAttributeErrorTests.test_attribute_error_inside_nested_getattr.<locals>.B.__getattribute__�s����A�C�C���w�rN)rrrr+)r�s�rr�r��s.�������
�
�
�
�
�
�
rr�rur�)	r{r:rrr]rzr�r�r{)rr�r/r5r�s    @r�*test_attribute_error_inside_nested_getattrz>AttributeErrorTests.test_attribute_error_inside_nested_getattr�sJ���	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�
	4�
�A�C�C�M�M�M���	4�	4�	4��(�*�*�
4�c��"�C�L�N�N�3�3�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4�
4����
4�
4�
4�
4����������	4����	
�
�
�n�c�l�l�n�n�5�5�5��
�
�g�s�|�|�~�~�.�.�.�.�.s8�/�
B
�B� A8�,B�8A<	�<B�?A<	�B�B
N)rrrr%r-r2rArGrMrSr_rprvr~r�r�r rrrr�s�������	)�	)�	)�+�+�+� 
+�
+�
+�%6�%6�%6�N
2�
2�
2�68�68�68�r2�2�2� /�/�/�63�3�3�:
9�
9�
9�
3�
3�
3�.�.�.�/�/�/�/�/rrc�&�eZdZd�Zd�Zd�Zd�ZdS)�ImportErrorTestsc���td��}|�|j��|�|j��tdd���}|�|jd��|�|j��tdd���}|�|jd��|�|j��tddd���}|�|jd��|�|jd��d}|�t|��5tdd	�
��ddd��n#1swxYwY|�t|��5tddd	���ddd��n#1swxYwY|�t|��5tdd
d	���ddd��n#1swxYwY|�t|��5td	�
��ddd��n#1swxYwY|�t|��5tdd	d���ddd��dS#1swxYwYdS)N�test�
somemoduler��somepath��path�somename)r�r�z8'invalid' is an invalid keyword argument for ImportError�keyword)�invalidr�)r�r�r�)r�r�T)r��another)rCr7r�r�r4r�rW)rr/rss   rr%z ImportErrorTests.test_attributes	s����&�!�!�����#�(�#�#�#����#�(�#�#�#��&�|�4�4�4�������<�0�0�0����#�(�#�#�#��&�z�2�2�2�������:�.�.�.����#�(�#�#�#��&�z�
�C�C�C�������:�.�.�.������:�.�.�.�H��
�
#�
#�I�s�
3�
3�	3�	3���	�2�2�2�2�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3����	3�	3�	3�	3��
#�
#�I�s�
3�
3�	@�	@���V�Y�?�?�?�?�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@����	@�	@�	@�	@��
#�
#�I�s�
3�
3�	@�	@���V�Y�?�?�?�?�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@�	@����	@�	@�	@�	@��
#�
#�I�s�
3�
3�	+�	+��	�*�*�*�*�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+��
#�
#�I�s�
3�
3�	A�	A���	�4�@�@�@�@�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A�	A����	A�	A�	A�	A�	A�	AsZ�5E�E�E�9F�F�F�>G�G!�$G!�H � H$�'H$�I&�&I*�-I*c��tddd���}|�|jd��|�|jd��|�|jd��|�|jd��|���|�|jd��|�|jd��|�|jd��|�|jd��dS)Nr�r�r��r�r��r�r )rCr4r�rsr�r�rrrs  r�test_reset_attributesz&ImportErrorTests.test_reset_attributes.	s����&�v�F�;�;�;�������9�-�-�-������&�)�)�)������6�*�*�*������6�*�*�*�	�����������2�&�&�&������$�'�'�'������4�(�(�(������4�(�(�(�(�(rc���tdtfd���5d}t|��}|�t	|��t	|����ddd��dS#1swxYwYdS)NrT)�quietsabc)r�BytesWarningrCr4r3)r�argr/s   r�test_non_str_argumentz&ImportErrorTests.test_non_str_argument<	s���
�R��.�d�
;�
;�
;�	1�	1��C��c�"�"�C����S��X�X�s�3�x�x�0�0�0�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1����	1�	1�	1�	1�	1�	1s�AA(�(A,�/A,c�R�t��td���td���tdd���fD�]g}tdi|��}ttjdz��D]�}tjtj||����}|�|jd��|�|j	d��|�|j
|j
��|�|j|j����tjtj
fD]�}||��}|�|jd��|�|j	d��|�|j
|j
��|�|j|j������idS)	Nr�r�r�r�r�r�rMr�)�dictrCrfrr	rbr
r4r�rsr�r��copy�deepcopy)r�kwargs�orig�protor/r�s      r�test_copy_picklez!ImportErrorTests.test_copy_pickleC	s����v�v���,�,�,���,�,�,���*�=�=�=�?�	6�	6�F��0�0��0�0�D��v�6��:�;�;�
6�
6���l�6�<��e�#<�#<�=�=��� � ���9�5�5�5�� � ���&�1�1�1�� � ���4�9�5�5�5�� � ���4�9�5�5�5�5��Y��
�-�
6�
6���a��g�g��� � ���9�5�5�5�� � ���&�1�1�1�� � ���4�9�5�5�5�� � ���4�9�5�5�5�5�
6�	6�	6rN)rrrr%r�r�r�r rrr�r�
	sT������ A� A� A�D)�)�)�1�1�1�6�6�6�6�6rr�c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�SyntaxErrorTestsc���dtd��fdtd��fdtd��fdtd��fdtd	��fd
td	��fdtd	��fdtd	��fd
td��fg	}|D]�\}}|�|���5	td|���#t$r~}tj��5}tjtj���ddd��n#1swxYwY|�||�	����|}Yd}~nd}~wwxYw	ddd��n#1swxYwY��dS)N)�bad.pyrMr��abcdefgrMr�z�
               File "bad.py", line 1
                 abcdefg
                  ^^^^^
             SyntaxError: bad bad
             )r�rMr�r�rMr�z�
               File "bad.py", line 1
                 abcdefg
                  ^
             SyntaxError: bad bad
             )r�rMr�r�rM���)r�rMr�r�rMr�z�
               File "bad.py", line 1
                 abcdefg
                    ^
             SyntaxError: bad bad
             )r�rM���r�rMr�zn
               File "bad.py", line 1
                 abcdefg
             SyntaxError: bad bad
             )r�rMr�r�rM���)r�rMrr�rMr)r�rMrr�rMr��r�rMr�r�rM�dz�
               File "bad.py", line 1
                 abcdefg
                  ^^^^^^
             SyntaxError: bad bad
             )r��bad bad)
rr2rQrrr]rzr�r�r{)r�casesr�rr/r5�
the_exceptions       r�test_range_of_offsetsz&SyntaxErrorTests.test_range_of_offsetsW	sj��/�
����
�/�
����
�0�
����
�/�
����
�1�
����
�1�
����
�/�
����
�/�
����
�1�
����
�MN
��^$�	(�	(�N�D�(����4��(�(�
(�
(�(�%�i��6�6�6��"�(�(�(� �0�2�2�<�c��*�C�L�N�N�;�;�<�<�<�<�<�<�<�<�<�<�<����<�<�<�<��M�M�(�C�L�L�N�N�;�;�;�$'�M�M�M�M�M�M�����	(����"�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(��	(�	(sZ�0E�2C�
E
�E� D	�?E�D
�E�D
�-E�E�E
�
E�E	�!E	c���d}	ttdd���5}|�|��ddd��n#1swxYwYtjdddt��\}}}|�d�����}|�|d	d
��|�|dd��tt��n#tt��wxYwd
}	ttdd���5}|�|��ddd��n#1swxYwYtjdddt��\}}}|�d�����}|�|d	d��|�|dd��tt��dS#tt��wxYw)NuU# -*- coding: cp437 -*-
"¢¢¢¢¢¢" + f(4, x for x in range(1))
r=�cp437r?r%�-X�utf8r>���u@    "┬ó┬ó┬ó┬ó┬ó┬ó" + f(4, x for x in range(1))r�z-                          ^^^^^^^^^^^^^^^^^^^z# -*- coding: ascii -*-

(
r�z    (z    ^)	r^r�writer	r)r��
splitlinesr4r
)rr��testfiler+r,r5s      r�test_encodingszSyntaxErrorTests.test_encodings�	s*��
M�	�		��f�c�G�4�4�4�
'�����v�&�&�&�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'����
'�
'�
'�
'�(�>�u�d�F�TZ�[�[�L�B��S��*�*�W�%�%�0�0�2�2�C����S��W�&h�i�i�i����S��W�&U�V�V�V��6�N�N�N�N��F�6�N�N�N�N����2��		��f�c�G�4�4�4�
'�����v�&�&�&�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'�
'����
'�
'�
'�
'�(�>�u�d�F�TZ�[�[�L�B��S��*�*�W�%�%�0�0�2�2�C����S��W�g�.�.�.����S��W�g�.�.�.��6�N�N�N�N�N��F�6�N�N�N�N���s]�C�=�C�A�C�A�BC�C2�8G�D1�%G�1D5�5G�8D5�9BG�G'c��	ttd��5}|�d��ddd��n#1swxYwYtjdddt��\}}}|�d�����}|�d|d��tt��dS#tt��wxYw)	N�bw��r%r�r�r>z8SyntaxError: Non-UTF-8 code starting with '\x89' in filer�)	r^rr�r	r)r�r�r�r
)rr�r+r,r5s     r�
test_non_utf8zSyntaxErrorTests.test_non_utf8�	s���	��f�d�#�#�
(�x����w�'�'�'�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(�(�>�u�d�F�TZ�[�[�L�B��S��*�*�W�%�%�0�0�2�2�C��M�M�U�WZ�[]�W^�_�_�_��6�N�N�N�N�N��F�6�N�N�N�N���s)�B=�9�B=�=�B=�=�A&B=�=Cc��d}td|��}|\}}}}}}|�||j��|�||j��|�||j��|�||j��|�||j��|�||j��|�d|j��dS)Nr�r��	rQr4r�r�r�r�r�r�rs)	rr�r�r�r�r��errorr�r�s	         r�test_attributes_new_constructorz0SyntaxErrorTests.test_attributes_new_constructor�	s���2��#�I�t�4�4�
�BF�?��&�&�%��Z�����=�#9�:�:�:������!5�6�6�6�����]�%=�>�>�>������!5�6�6�6�����]�%=�>�>�>�����
� 2�3�3�3�����M�$5�6�6�6�6�6rc��d}td|��}|\}}}}|�||j��|�||j��|�d|j��|�||j��|�d|j��|�||j��|�d|j��dS)N)r�rMr�r�r�r�)rr�r�r�r�r�r�s       r�test_attributes_old_constructorz0SyntaxErrorTests.test_attributes_old_constructor�	s���*��#�I�t�4�4�
�*.�'��&�&�%�����=�#9�:�:�:������!5�6�6�6�����}�7�8�8�8������!5�6�6�6�����}�7�8�8�8�����
� 2�3�3�3�����M�$5�6�6�6�6�6rc���d}|�ttd|��d}|�ttd|��d}|�ttd|��dS)N)r�rMr�r�)r�rMr�r�r�r�r�)r�rMr�r�rM)r[rWrQ�rr�s  r�test_incorrect_constructorz+SyntaxErrorTests.test_incorrect_constructor�	se�������)�[�)�T�B�B�B�+�����)�[�)�T�B�B�B�-�����)�[�)�T�B�B�B�B�BrN)	rrrr�r�r�r�r�r�r rrr�r�V	sw������X(�X(�X(�t���:
�
�
�
7�
7�
7�
7�
7�
7�C�C�C�C�Crr�c��eZdZd�ZdS)�TestInvalidExceptionMatcherc�.�|�t��5	t�#d$rYnwxYw	ddd��n#1swxYwY|�t��5	t�#tdf$rYnwxYw	ddd��dS#1swxYwYdS)Nr)r[rWrXr*s r�'test_except_star_invalid_exception_typezCTestInvalidExceptionMatcher.test_except_star_invalid_exception_type�	sF��
�
�
�y�
)�
)�	�	�
� � ���
�
�
���
�����		�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�y�
)�
)�	�	�
� � ����#�
�
�
���
�����		�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	sS�<�$�,�<�,�<�A�A�!B
�#A*�*A9�6B
�8A9�9B
�
B�BN)rrrr�r rrr�r��	s#����������rr�c�P�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS)
�PEP626Testsc�`�	|��|�d��n#t$r}|j}Yd}~nd}~wwxYwg}|j}|r@|j}|�|j�dn|j|jjz
��|j}|�@|�	t|��|��dS)Nr*)rhr)r&�tb_nextr�r�f_linenor��co_firstlinenor4�tuple)rrErr��t�lines�frames       r�lineno_after_raisezPEP626Tests.lineno_after_raise
s���	-�
�A�C�C�C�
�I�I�+�,�,�,�,���	!�	!�	!�� �A�A�A�A�A�A�����	!������
�I���	��J�E��L�L���.�����u�|�:�:�
�
�
��	�A�
�	�	
����u���x�0�0�0�0�0s�
"�
=�8�=c�8�d�}|�|d��dS)Nc��ddzdSr�r r rr�simplez:PEP626Tests.test_lineno_after_raise_simple.<locals>.simple!
s��
�a�C�C��DrrM�r�)rr�s  r�test_lineno_after_raise_simplez*PEP626Tests.test_lineno_after_raise_simple 
s/��	�	�	�	
�����*�*�*�*�*rc�8�d�}|�|d��dS)Nc�,�	ddzdS#ddzYdSxYwr�r r rr�	in_exceptz@PEP626Tests.test_lineno_after_raise_in_except.<locals>.in_except'
s-��
��!������
��!��������s�	�r�r�)rr�s  r�!test_lineno_after_raise_in_exceptz-PEP626Tests.test_lineno_after_raise_in_except&
s/��	�	�	�	
���	�1�-�-�-�-�-rc�8�d�}|�|d��dS)Nc�B�	ddzdS#t$r}Yd}~dSd}~wwxYwr�)rWr�s r�other_exceptz@PEP626Tests.test_lineno_after_other_except.<locals>.other_except0
s@��
��!�������
�
�
�����������
���s�	�
�r�r�)rr�s  r�test_lineno_after_other_exceptz*PEP626Tests.test_lineno_after_other_except/
s/��	�	�	�
	
����a�0�0�0�0�0rc�8�d�}|�|d��dS)Nc�L�	ddzdS#t$r}ddzYd}~dSd}~wwxYwr�r(r�s r�in_named_exceptz@PEP626Tests.test_lineno_in_named_except.<locals>.in_named_except8
sI��
��!�������
�
�
��!�������������
���s�	�
#��#r�r�)rr�s  r�test_lineno_in_named_exceptz'PEP626Tests.test_lineno_in_named_except7
s/��	�	�	�	
�����3�3�3�3�3rc�8�d�}|�|d��dS)Nc��	ddzdS#wxYwr�r r rr�in_tryz.PEP626Tests.test_lineno_in_try.<locals>.in_tryA
s��
��!���������s�	�r�r�)rr�s  r�test_lineno_in_tryzPEP626Tests.test_lineno_in_try@
s/��	�	�	�
	
�����*�*�*�*�*rc�8�d�}|�|d��dS)Nc�(�		ddzdS#ddzwxYwr�r r rr�in_finally_normalzDPEP626Tests.test_lineno_in_finally_normal.<locals>.in_finally_normalI
s-��
���!�������!������s�r�r�)rr�s  r�test_lineno_in_finally_normalz)PEP626Tests.test_lineno_in_finally_normalH
�0��	�	�	�	
��� 1�1�5�5�5�5�5rc�8�d�}|�|d��dS)Nc�0�	ddzddzdS#ddzwxYwr�r r rr�in_finally_exceptzDPEP626Tests.test_lineno_in_finally_except.<locals>.in_finally_exceptR
s3��
��!����!�������!������s��r�r�)rr�s  r�test_lineno_in_finally_exceptz)PEP626Tests.test_lineno_in_finally_exceptQ
r�rc�X��Gd�d����fd�}|�|d��dS)Nc��eZdZd�Zd�ZdS)�0PEP626Tests.test_lineno_after_with.<locals>.Noopc��|Srr r*s rrjz:PEP626Tests.test_lineno_after_with.<locals>.Noop.__enter__\
rkrc��dSrr r�s  rrpz9PEP626Tests.test_lineno_after_with.<locals>.Noop.__exit__^
s���rNrqr rr�Noopr�[
s2������
�
�
�
�
�
�
�
rr�c�Z�����5ddz	ddd��dS#1swxYwYdSr�r )r�s�r�
after_withz6PEP626Tests.test_lineno_after_with.<locals>.after_with`
s�������
�
��!����
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s� �$�$r�r�)rr�r�s  @r�test_lineno_after_withz"PEP626Tests.test_lineno_after_withZ
sb���	�	�	�	�	�	�	�	�
	�	�	�	�	�	
���
�A�.�.�.�.�.rc��d�}|�|d��|j�d���|_|�|d��dS)Nc��ddzdSr�r r rrrEz8PEP626Tests.test_missing_lineno_shows_as_none.<locals>.fg
s��
�a�C�C�C�CrrMs�������)�co_linetable)r��__code__r�)rrEs  r�!test_missing_lineno_shows_as_nonez-PEP626Tests.test_missing_lineno_shows_as_nonef
s^��	�	�	�����1�%�%�%��Z�'�'�5T�'�U�U��
�����4�(�(�(�(�(rc�Z��Gd�d����fd�}|�|dd��dS)Nc��eZdZd�Zd�ZdS)�CPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFailsc��|Srr r*s rrjzMPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFails.__enter__o
rkrc��t�rrGr�s  rrpzLPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFails.__exit__q
s�� � rNrqr rr�	ExitFailsrn
s2������
�
�
�
!�
!�
!�
!�
!rrc�X�����5ddzddd��dS#1swxYwYdSr�r )rs�rr�zDPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.after_witht
s|�������
�
��!���
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s��#�#rMr�)rr�rs  @r�$test_lineno_after_raise_in_with_exitz0PEP626Tests.test_lineno_after_raise_in_with_exitm
sd���	!�	!�	!�	!�	!�	!�	!�	!�	�	�	�	�	�	
���
�A�q�1�1�1�1�1rN)rrrr�r�r�r�r�r�r�r�rrr
r rrr�r�
s�������1�1�1�$+�+�+�.�.�.�1�1�1�4�4�4�+�+�+�6�6�6�6�6�6�
/�
/�
/�)�)�)�
2�
2�
2�
2�
2rr��__main__)*r��gcrjr]r�rrsr��textwrapr�test.supportrrrrrr	r
�test.support.import_helperr�test.support.os_helperrr
�test.support.warnings_helperrr�rr)rr"r&�TestCaser-�global_for_suggestionsr�rr�r�r�r�rr�r rr�<module>rs0������	�	�	�	�	�	�	�	�
�
�
�
�����
�
�
�
���������������/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�5�4�4�4�4�4�1�1�1�1�1�1�1�1�7�7�7�7�7�7������������Y���������I����
+�+�+�+�+��+�+�+�\�\�\�\�\�X�&�\�\�\�|4��n;�n;�n;�n;�n;�X�&�n;�n;�n;�b	P/�P/�P/�P/�P/�(�+�P/�P/�P/�fJ6�J6�J6�J6�J6�x�(�J6�J6�J6�XdC�dC�dC�dC�dC�x�(�dC�dC�dC�N�����(�"3����k2�k2�k2�k2�k2�(�#�k2�k2�k2�Z�z����H�M�O�O�O�O�O��r