python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_exceptions.cpython-312.opt-2.pyc

͑e},6ddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZmZmZddlmZddlmZmZddlmZddlmZGdd	eZGd
deZGdd
eZGddej<ZGddej<Z Gddej<Z!Gddej<Z"Gddej<Z#Gddej<Z$Gddej<Z%e&dk(rejNyy)N)dedent)captured_stderrcheck_impl_detailcpython_only
gc_collect
no_tracing
script_helperSuppressCrashReport)
import_module)TESTFNunlink)check_warnings)supportceZdZdZy)NaiveExceptionc||_yNxselfrs  H/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_exceptions.py__init__zNaiveException.__init__	N__name__
__module____qualname__rrrrrsrrceZdZdZdZy)SlottedNaiveExceptionrc||_yrrrs  rrzSlottedNaiveException.__init__rrN)rrr	__slots__rr rrr"r"sIrr"ceZdZdZy)BrokenStrExceptionctd)Nzstr() is broken	Exceptionrs r__str__zBrokenStrException.__str__ s)**rN)rrrr+r rrr&r&s+rr&ceZdZdZdZdZdZdLdZdZdZ	e
d	Zd
Ze
jej dk(dd
ZdZdZdZdZdZdZdZdZdZdZdZdZedZdZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/d+Z0d,Z1d-Z2d.Z3d/Z4d0Z5d1Z6d2Z7d3Z8d4Z9d5Z:ed6Z;e
e<jzd7d8Z>e
d9Z?e
d:Z@d;ZAe
d<ZBe
d=ZCe
d>ZDe
d?ZEed@ZFdAZGdBZHdCZIe
dDZJdEZKdFZLdGZMe
jdHdIdJZNdKZOy)MExceptionTestscH|j||5	|d#|$r}t|}Yd}~nd}~wwxYw	|d#|$r}t|}Yd}~nd}~wwxYw|j|||j|j|dddy#1swYyxYw)N)excexcnamespam)subTeststrassertEqualr)rr/r0errbuf1buf2s      rraise_catchzExceptionTests.raise_catch's
\\c7\
3
	4
 &k!
 3x
 
 &k!
 3x
 T4(S\\73
	4
	4
	4sHB83B8BAA	ABA1BB!c|jtd|jtttd|jt
dt
tdd}|jt
tdd}tj}		ddl
}|jd	|t_	|jtt|jtd
|jttdd|jtd|jttd
|jt dg}|jt |j"d|jt$di}|jt$|j"d|jt&d|jt(d|jt*dt,}|jt.dd}t1dD]}||z
}	|jt2d|jt4d|jt6dt9d|jt:d|jt<dt?ddd |jAd!|jtBd"|jtDd#|jtDtjFd|jtHd$gd%z|jtJd&|jtJtLd'|jtNd(ddz}|jtPd)ddz}|jtRd*y#t
$rYwxYw#|t_	|jttwxYw#t*$rYwxYw#t6$rYwxYw#t<$rYUwxYw#tH$rYwxYw#tN$rYwxYw#tP$r
}Yd}~d}~wwxYw)+NAttributeErrorundefined_attributeEOFErrorwutf-8encodingrrrOSErrorzthis file does not existImportErrorundefined_module
IndexError
KeyErrorkeyKeyboardInterruptMemoryError	NameError
OverflowErrorRuntimeErrorRecursionErrorSyntaxErrorz/
IndentationErrorTabErrorz"try:
	1/0
    	1/0
finally:
 pass
z<string>execzTabError not raisedSystemError
SystemExit	TypeErrorr 
ValueErroriZeroDivisionErrorr)StopAsyncIteration)*r8r:assertRaisesgetattrsysr<openrclosestdinmarshalloadsr
rBrC
__import__rE__getitem__rGrIrJrKundefined_variablerLrangerOrPrQrTrRrScompilefailrUrVexitrWrXchrrYr)rZ)rfp	savestdinrardummyes       rtestRaisingzExceptionTests.testRaising4s\)9:.'38MN:.
&#
0


&#
0II			


c""CIHHJ6N),'4)CSIm4+z3EF\2*ammR8:.(AMM59*,?@m4K0#Q	
8
3Z	E
FA		
~6)9:m4
%[	
)+=>:.
@)ii-.m4\2*chh2K0
"W	
\2*c62*,?@1Q	
K01Q	
+-ABK

"CIHHJ6N,$ D $!&$&#t#sN)OO,
O<P&PP*	N*&N-)N**N--,O	O)(O),	O98O9<	P	P		PP	P'&P'*	P=8P=cJfd}d}||d|dd|ddy)Nc j||5	t|ddjddddy#t$r:}|j|k7r!jd|d|jYd}~Gd}~wwxYw#1swYyxYw)N)srcmsg
<fragment>rT"failed to get expected SyntaxError	expected , got )r2rgrhrQrs)rrrsrnrs   rckmsgz4ExceptionTests.testSyntaxErrorMessage.<locals>.ckmsgs#3/
DDCv6
IIBC
D
D#Huu|		3"FGH
D
Ds1B
>B	B0A<7B<BBB
zHif 1:
        try:
            continue
        except:
            passz'continue' not properly in loopz	continue
zf'{6 0}'z+invalid syntax. Perhaps you forgot a comma?r rrxss`  rtestSyntaxErrorMessagez%ExceptionTests.testSyntaxErrorMessages3	D
	a23
l=>
jGHrctffd	}d}||dd}||dd}||dd}||dd}||dd	}||d
d}||d
d}||d
td}||dty)Nc	t|ddjdy#|$r?}|j|k7r&jd|d|jYd}~yYd}~yd}~wwxYw)NrtrTrurvrw)rgrhrs)rrrs	exceptionrnrs    rrxz:ExceptionTests.testSyntaxErrorMissingParens.<locals>.ckmsgs`
@\62
		>?	
D55C<IIsAEEBCC 
Ds
"A&0A!!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`  rtestSyntaxErrorMissingParensz+ExceptionTests.testSyntaxErrorMissingParenss&1	@
$
aST$
aST
aST"
aQR
aQR

!
a!"
a!"
.
aLN^_K
aExPrNc|j|||5|jt5}t|ddddd|j	j
j||j	|j
j||&|j	|j
j||&|j	|j
j||j
j_t|ts|j|d}|jd|dz
}|j||j
jdddy#1swY$xYw#1swYyxYw)N)sourcelinenooffsetrtrTreplace
rM)r2r[rQrgr4r~rr
end_lineno
end_offsettext
isinstancer3decodesplitassertIn)	rrrrrrrr@cmlines	         rcheckzExceptionTests.checks+
\\VF\
C	7"";/
32\62
3R\\00&9R\\00&9%  !8!8*E%  !8!8*E||  ,!#s+**Xy9Cyyvax0

dBLL$5$56	7	7
3
3	7	7s"E(EDE(E%	 E((E1c0|j}|dddy)Nz"\
"(1 for c in I,\
\rrrs  r)test_error_offset_continuation_charactersz8ExceptionTests.test_error_offset_continuation_characterss


*Aq1rc|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|dVddy)WNzdef fact(x):
	return x!
rrFz1 +
rMz def spam():
  print(1)
 print(2)zPython = "Python" +uPython = "Ṕýţĥòñ" +s+# -*- coding: cp1251 -*-
Python = "ϳ" +cp1251r?sPython = "ϳ" +zx = "azlambda 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*:
  passz6try:
  pass
except*:
  pass
except* ValueError:
  passz(0x+1)zx = 0xIz0010 + 2z
x = 32e-+4zx = 0o9uα = 0xIsα = 0xIs## -*- coding: iso8859-7 -*-
 = 0xIz	iso8859-7sif 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('我')
rz7f'''
            {
            (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(*):
  passrrs  rtestSyntaxErrorOffsetz$ExceptionTests.testSyntaxErrorOffsetsg


+Q3
gq!
2Ar:
#Q+
;QC
Lh	(
2Ar:
h1
A&
na#
,a4
+Q2
11a8
,a3
-q!4
I1bQ
oq!$
mQ"
"Aq!R0
'Aq"5
"Aq!R0
%q!Q3	"Ar*
$a+
!1a(
I1aP
.15
KQPQR	h1
iA
j!Q
lAq!
iA
na#
A&
8!Q"	$
	B			8!Q?
fa
%q!,
CQK
				
		11a8
+Q3
$a,
CQK
'A.
.15
lAq!
2Aq9	3Q:
-q!4
4a;
j!Q
%q!,
 !Q'
.15
!1a(
oq!$
!1a(rcGddtGddfd}fd}fd}|||y)NceZdZdZy)9ExceptionTests.testSettingException.<locals>.BadExceptionctd)Nzcan't instantiate BadException)rO)self_s rrzBExceptionTests.testSettingException.<locals>.BadException.__init__Gs"#CDDrNrr rrBadExceptionrFs
ErrceZdZy)=ExceptionTests.testSettingException.<locals>.InvalidExceptionNrrrr rrInvalidExceptionrJrrcNddl}	|jdjdy#t$rp}|jj
j}j|jdj|jjdYd}~yd}~wwxYw)NrrMExpected exception
test_capi1test_exceptions.py)	_testcapiraise_exceptionrhrW
__traceback__tb_framef_coder4co_name
assertTrueco_filenameendswith)rr5corrs   rrz7ExceptionTests.testSettingException.<locals>.test_capi1Ms
0)),:		./
O&&//66  \: 7 78L MNN
Os+	B$A&BB$cddl}	|jdjdy#t$r}|jj
}|jj}j|jdj|jjd|jjj}j|jdYd}~yd}~wwxYw)Nrrrr
test_capi2)rrrhrOrtb_nextrrr4rrrrf_back)rr5tbrco2rrs     rrz7ExceptionTests.testSettingException.<locals>.test_capi2Xs

0)),:		./ 
<&&..[[''  Z8 7 78L MNkk((//  l;;

<s+	C,B.C''C,cRddl}jt|jdy)NrrM)rr[rUr)rrrs r
test_capi3z7ExceptionTests.testSettingException.<locals>.test_capi3fs#k9+D+D.
3rr()rrrrrrs`   @@rtestSettingExceptionz#ExceptionTests.testSettingExceptionAs;
	E9	E				0	0	3
	rc	t|jtt|jt	tdd|jt	tdddtddd}|j|j
d|j|jd|jt	|dtd	ddd
}|j|j
d|j|jd
|j|jd|j|jd|j|jd|jt	|dtd	ddd}|j|j
d
|j|jd|j|jd|j|jd|j|jd|jt	|dtdd}|j|j
d|j|jd|j|jd|j|jd|j|jdy#t$rYywxYw)Ni1001messagez[Errno 1001] messagerfoobarz[Errno 9] foo: 'bar'rrrz[WinError 3] foo: 'bar'z[WinError 1001] foo)WindowsErrorassertIsrBr4r3errnowinerrorstrerrorfilename	filename2rK)rr=s  rtest_WindowsErrorz ExceptionTests.test_WindowsErroros6$	0
MM,0S/8Sy!9:3
55%(AQWWa(QZZ.SV%;<5%+AQWWa(QZZ+QZZ/QZZ/Q[[$/SV%>?5$-AQWWb)QZZ.QZZ/QZZ.Q[[$/SV%:;u%AQWWe,QZZ.QZZ/QZZ.Q[[$/E		sK	KKwin32ztest specific to Windowsc	td}d}|jtd|z5|jj	|dddy#1swYyxYw)Nctypeslcs@zWindows Error 0x%x)rassertRaisesRegexrB	pythonapiPyErr_SetFromWindowsErr)rrcodes   rtest_windows_messagez#ExceptionTests.test_windows_messagesV	Ix(

#
#G-AD-H
I	;44T:	;	;	;sA

Ac\tdiddiftdiddiftdiddiftdiddiftdidddftdiddddddftd	id	dddd
dftdid	dddd
dftd
id	dddftdidddddftdiddddddftdiddddddddftdidddddddddftdidd ddddd!d"d#d$	ftd%idd%dddddddd&	ftdiddift
d'id'd(d)d*d+d,ftd(td-d*dd+fid(td-d*dd+fd(d-d*d+d,ftd.id.d(d-d*d+d,ftd/id/d0d1d*dd2ftdiddd3ftdiddd3ftdtd4d56tdd4d57fg}	|jtdiddddddd8f|D]W\}}}}	||i|}t!|j"j%d9s%|j't!|j(d:t+|}|D]D}t-||}	|j't/|	t/|||d;|d<|	d=||Ft0fD]}
t3|
j4dzD]}|
j7||}|
j9|}|D]X}t/t-||}
|tk(r|d5k(rt/d}nt/||}|j'|
|d>|d?|ZZy#t$rYjwxYw#t;d@|dA|t<j>BYxYw)CNr args)rM)r)rrMr)rr)rrrrr)rrr)rrbazr)rrrNquuxr)rrr)errnoStrstrErrorStrfilenameStr)rrrrr)rrrr)rMrr)rMrrM)rrrrr)rsrrrrrprint_file_and_line)msgStrr)rrrrsrrrr)r)r	linenoStr	offsetStrtextStrendLinenoStrendOffsetStrrrrrr)	rrrrrsrrrr)rrrrrrrprint_file_and_lineStr)	rrrrsrrrrr)asciiarrMordinal not in rangerrrr)rr@objectstartreason)rrrrMr)あrrMouchrr)rrrrend)rrnameobjrr)rrr)rrrrrrrbuiltins.z == z, expected z	pickled "z", attribute "z
exc=z, args=)file) 
BaseExceptionrVrBrQUnicodeErrorUnicodeEncodeErrorUnicodeDecodeError	bytearrayUnicodeTranslateErrorrr"r:dictappendrrKtyperrr4rr3r\reprpicklerfHIGHEST_PROTOCOLdumpsrbprintr]stderr)r
exceptionListr/rkwargsexpectedrnrzcheckArgNamevaluepprotocolnewgotwants               rtestAttributeszExceptionTests.testAttributessBVbM2
E27
Hb(#
%
J*%
'
2"U3
5
h"Td4
5nb("$ u6
7+R(#4 u6
792(u6R
T
@"5+z+-
.7,++4A
B"b4$!dt"D#B
C+r%)-x"t#%
&
GHJ')G*.x+-^
M
N5685*.x"t#4
9	
:2rFR>2
":;=C%#)?A
B '9W+=q!"8":;="Ig$61+AC%')?A
B ":;=C%')?A
B#$<b2$a)
*Xr!.
0
"Hb!.
0
XtU'C(U;
=iV

n
	  @"0"/d "/tEF
,9#	@'Cvx"
@((Aw''001AB$$T!W%7%7DF$,EL#A|4E$$T%[%)(<*@%A%&%*H\,B&DEE!@A$)!*<*<q*@$A
@GGAx0ggaj,4
@L"&wsL'A"BC"n49N(,Dz'+H\,B'C ,,S$./.?@
@
@@+#	@		
HsgWTH5CJJGGs7 K5#L5	LL#L+ctd}d|_|j|jd|j|jd|j	t
t|d|j	t
t|d|jddd|j|jd|j|jd|j|jd|j|jd|jd	d
dd|j|jd
|j|jd|j|jd	|j|jdy)
N*5)rrbrMr)rrr)rMrr#)rrblah)
r)rr4rr[r:r\__setstate__rrrrns  r
test_setstatezExceptionTests.test_setstate+s&bM'$.'1c:.'1c:	Qa()'$a a 	R"=>)$b!a rctd}|jtd5|jddddy#1swYyxYw)Nrzstate is not a dictionary)r)rrWr r!s  rtest_invalid_setstatez$ExceptionTests.test_invalid_setstate=s=bM

#
#I/J
K	
NN2			s	=ActdtdtdfD]}|j|5|j	t|d|j
d|j|jdg|jt5|j
dddd|j|jdg|j
d|j|jddg|`|j	t|d|j
d	|j|jd	gd|_|j|jd|jt5|j
d
ddd|j|jddddy#1swYxYw#1swY>xYw#1swYxYw)NrMrrrn	__notes__zMy Noterz	Your NotezOur Notez
will not work)rr)rXr2assertFalsehasattradd_noter4r'r[rWr!s  r
test_noteszExceptionTests.test_notesBs"IaL*Q-@	2A"
2  K!89

9%  yk:&&y1#JJrN#  yk:

;'  y+.FGK  K!89

:&  zl;   b1&&y10JJ/0  b1/
2
2	2## 00+
2
2s=AGG(CG?G$GGGGGG$	c4	td#t$r}|j}Yd}~nd}~wwxYwtj	|}|j|t|j
|j|tdj	|}|j|t|j
|j|Gddt}|j	|}|j|||j
|j|y)NrrceZdZy)5ExceptionTests.testWithTraceback.<locals>.MyExceptionNrr rrMyExceptionr.krrr/)rEr)rrwith_tracebackassertIsInstancer4)rrnrr/s    rtestWithTracebackz ExceptionTests.testWithTraceback]s	!Q-	!B	!
O**2.a/"-qM((,a,"-	)	
M((,a-"-
	,',c	dt_|jdy#t$r%}|j	dt|Yd}~yd}~wwxYw)NrNo exception raisedz!__traceback__ must be a traceback)r)rrhrWrr3r!s  rtestInvalidTracebackz#ExceptionTests.testInvalidTracebackrsJ	-()IK%
II+,	GMM=s1vFF	Gs#	AAAct}t}d}|j||t|ddd}|j||t|ddd}|j||t|ddd}|j||t|d	dy)
Nz'int' object is not iterablerrMz)__traceback__ must be a traceback or Nonerz9exception cause must be None or derive from BaseException	__cause__z;exception context must be None or derive from BaseException__context__)rWr)rsetattr)rTEr/rss    rtest_invalid_setattrz#ExceptionTests.test_invalid_setattrzs
k,r3fa@9r3oqIIr3k1EKr3mQGrc$t}	td#t$r}|}Yd}~nd}~wwxYwd}|j||t|d|j||t|d|j||t|d|j||t|dy)Nrzmay not be deletedrrr8r9)rWrEr)rdelattr)rr;rnr/rss     rtest_invalid_delattrz#ExceptionTests.test_invalid_delattrs
	Q-	C	#r3f=r3oFr3kBr3mDs	(#(c	td#t$r}|j}Yd}~nd}~wwxYwt}||_d|_|j|jdy)Nr)rEr)rr4)rrnrs   rtestNoneClearsTracebackAttrz*ExceptionTests.testNoneClearsTracebackAttrsU	!Q-	!B	!
K$/r3ct}|j|j|j|jt	}|j|j|j|jGddt
}|}|j|j|j|jy)NceZdZy)5ExceptionTests.testChainingAttrs.<locals>.MyExceptionNrr rrr/rDrrr/)r)assertIsNoner9r8rWrB)rrnr/s   rtestChainingAttrsz ExceptionTests.testChainingAttrssK!--(!++&K!--(!++&	'	
M!--(!++&rc	t#t$r}|}Yd}~nd}~wwxYw|j|j|j|j|j	|j
t
|_d|_|j|jt|j|j|j|j
d|_|j	|j
y)NF)	r)rEr9r8r(__suppress_context__rKr1r)rr/rns   rtestChainingDescriptorsz&ExceptionTests.testChainingDescriptorss	+	A		
!--(!++&//0!
ammY7!++&../!&//0s
	!!c|jttdGddt}|d}|j|jdy)NrM)rceZdZdZy)8ExceptionTests.testKeywordArgs.<locals>.DerivedExceptionc<tj|||_yr)rr	fancy_arg)rrNs  rrzAExceptionTests.testKeywordArgs.<locals>.DerivedException.__init__s&&t,!*rNrr rrDerivedExceptionrLs
+rrOr)rN)r[rWrr4rN)rrOrs   rtestKeywordArgszExceptionTests.testKeywordArgssE	
)]a8	+}	+

r*b)rctfd|jtfd|jty)NcSrr )fsrrSz/ExceptionTests.testInfiniteRecursion.<locals>.fs
3Jrc2	S#t$rYywxYw)NrrXgsrrWz/ExceptionTests.testInfiniteRecursion.<locals>.gs!
s


s
	)r[rP)rrSrWs @@rtestInfiniteRecursionz$ExceptionTests.testInfiniteRecursions/	.!,	
	
.!,rc|jtt|jttd|jttddy)Nrr)rr3r)r*s rtest_strzExceptionTests.test_strs?I'IcN+,Ic3/01rc	t#t$r }|j|tYd}~nd}~wwxYw|jdt|j	t
5dddy#1swYyxYwNrnr)r1assertNotInlocalsr[UnboundLocalErrorr!s  rtest_exception_cleanup_namesz+ExceptionTests.test_exception_cleanup_namessk	0+	0!!!Y//	0fh'


0
1	
			s
	505'A33A<c	t#t$r!}|j|t~Yd}~nd}~wwxYw|jdt|j	t
5dddy#1swYyxYwr\r]r!s  rtest_exception_cleanup_names2z,ExceptionTests.test_exception_cleanup_names2sm	+	!!!Y/		
fh'


0
1	
			s
	616(A44A=cGddtGdd}fd}|tj}	|dt||j	|tj}	|dt||j	|tj}	|dt||j	|tj}dD]
}	|dt||j	|tj}		|	|tj}	|dtdr
t||j	Gd	d
}|tj}|5|ddddtdr
t||j	y#$r}Yd}~d}~wwxYw#$rYwxYw#YxYw#Y9xYw#t
xYw#t
$rL}d|_dt|tdr
t|j	Yd}~Md}~wwxYw#$r		#xYw#$rYnwxYwYLwxYw#1swYxYw)NceZdZdZy)=ExceptionTests.testExceptionCleanupState.<locals>.MyExceptionc||_yrrrrs  rrzFExceptionTests.testExceptionCleanupState.<locals>.MyException.__init__	rNrr rrr/rf
rr/ceZdZy)7ExceptionTests.testExceptionCleanupState.<locals>.MyObjNrr rrMyObjrmrrrnc}rr )	local_refr/rs rinner_raising_funczDExceptionTests.testExceptionCleanupState.<locals>.inner_raising_funcsIc""r)rF)cpythonceZdZdZdZy)9ExceptionTests.testExceptionCleanupState.<locals>.Contextc|Srr r*s r	__enter__zCExceptionTests.testExceptionCleanupState.<locals>.Context.__enter__arcy)NTr )rexc_type	exc_valueexc_tbs    r__exit__zBExceptionTests.testExceptionCleanupState.<locals>.Context.__exit__csrNrrrrvr|r rrContextrt`s

rr~)r)weakrefrefrrErGr9r)	rrnrqwrrnir~r/rs	       @@rtestExceptionCleanupStatez(ExceptionTests.testExceptionCleanupStates	)				#g
[[
	 d#g
[[
	 d#g
[[
	 d#g
[[
	A
"$	
d#g
[[
	#
"$$g
[[
		 U+Ld#		
g
[[

Y	! 	!U+Ld#G					

	#
!AMCL$C /c""	#&	


	,	!	!sH1III'I!K0K#1I<II
I
II!I))I,,	K5AJ<<KK KKKKK KK K #K,cXfd}	ty#t$r|YdydwwxYw)Nc
yrr r&srprint_errorzIExceptionTests.test_exception_target_in_nested_scope.<locals>.print_errorrs
r)	somethingr))rrrns  @r%test_exception_target_in_nested_scopez4ExceptionTests.test_exception_target_in_nested_scopeos'			MM	s	)$)cBd}|}|jt|t|jt	j
|jt|t|jt	j
|jt|	t
d#t$r|}|jt|t|jt	j
t|jt|t|jt	j
t|jt|t~|jt	j
tYywxYw)Nc3K	td#t$r/tjtjYnwxYwtjyw)Ncaught)rGr]r~r rryield_raisez:ExceptionTests.test_generator_leaking.<locals>.yield_raise}sK
&x((
&mmo%mmo%
&--/!s A!5AA!AA!r)r1nextrGrEr]r~rW)rrrWs   rtest_generator_leakingz%ExceptionTests.test_generator_leakingzs	"
Md1gx0#--/*d1gx0#--/*$q'"
	>E""	>
A!!$q'84!!#--/9=!!$q'84!!#--/9=!!$q'95!!#--/9=	>s*B55C&FFcd}	t#t$r|}t|YnwxYw	t|n#t$rYnwxYw|jt	j
y)Nc3Kdywrr r rrrWz1ExceptionTests.test_generator_leaking2.<locals>.gs	)rOr
StopIterationrEr]r~rrWits   rtest_generator_leaking2z&ExceptionTests.test_generator_leaking2sa			BH		H		#--/*s))9	AAcd}|}t|	ddz|j
tjy#t$ru}|jtj||j|}|jtj||j||Yd}~d}~wwxYw)Nc3`K	dy#t$rtjYywxYwwrrYr]r~r rrrWz1ExceptionTests.test_generator_leaking3.<locals>.gs(
&$
&mmo%
&s.	.+.+.rMr)rrYrr]r~throwrE)rrWrrngen_excs     rtest_generator_leaking3z&ExceptionTests.test_generator_leaking3s	&
SR	&
aC	
#--/*!	&MM#--/1-hhqkGMM#--/1-MM'1%%		&sA	B>	A+B99B>cld}|}	t#t$rtt|}YnwxYw|j|t	t|n:#t$r.}|jtj|Yd}~nd}~wwxYw|jtjy)Nc3`K	ddzy#t$rtjwxYwwNrMrrr rrrWz1ExceptionTests.test_generator_leaking4.<locals>.gs/
!$
mmo%
s.
.!+.)rWrrrrYr]r~rE)rrWrtprns     rtest_generator_leaking4z&ExceptionTests.test_generator_leaking4s	S	 O	 d2hB	 	


b+,	.H!	.MM#--/1--	.	
#--/*s$22A	B!$B

Bcfd}|}	t#t$rt|YnwxYwjtt|y)Nc3Kjtjtdj	tjywr)r1r]r~rOrEr*srrWz>ExceptionTests.test_generator_doesnt_retain_old_exc.<locals>.gs4!!#--/<@cmmo.sAA)rOrr[rrs`  r$test_generator_doesnt_retain_old_excz3ExceptionTests.test_generator_doesnt_retain_old_excsD	/S		H	-r2s,,c~dfd}|t|jtjy)Nc3KdywNrMr r rr
simple_genzNExceptionTests.test_generator_finalizing_and_sys_exception.<locals>.simple_gensGrcT}	t#t$rt|cYSwxYwr)rOr)genrs rrun_genzKExceptionTests.test_generator_finalizing_and_sys_exception.<locals>.run_gens.,C
!""
!Cy 
!s'')rrEr]r~)rrrs  @r+test_generator_finalizing_and_sys_exceptionz:ExceptionTests.test_generator_finalizing_and_sys_exceptions-		!		#--/*rcGddtGdd}fd}|tj}|}t|||dx}t	||jy)NceZdZdZy)FExceptionTests._check_generator_cleanup_exc_state.<locals>.MyExceptionc||_yrrhris  rrzOExceptionTests._check_generator_cleanup_exc_state.<locals>.MyException.__init__rjrNrr rrr/rrkrr/ceZdZy)@ExceptionTests._check_generator_cleanup_exc_state.<locals>.MyObjNrr rrrnrrrrnc3<K	#$rdYywxYwwrr )r/rsrraising_genzFExceptionTests._check_generator_cleanup_exc_state.<locals>.raising_gens(
!#&&

s
	)r)rrrrrE)rtestfuncrnrrrWr/rs      @@r"_check_generator_cleanup_exc_statez1ExceptionTests._check_generator_cleanup_exc_statesm	)				g
[[
MQCd#rc,d}|j|y)NcV	|jty#t$rYywxYwr)rrOrVs rdo_throwzGExceptionTests.test_generator_throw_cleanup_exc_state.<locals>.do_throw	s'
'

s	((r)rrs  r&test_generator_throw_cleanup_exc_statez5ExceptionTests.test_generator_throw_cleanup_exc_states	
	
//9rc,d}|j|y)Nc$|jyr)r_rVs rdo_closezGExceptionTests.test_generator_close_cleanup_exc_state.<locals>.do_closes
GGIrr)rrs  r&test_generator_close_cleanup_exc_statez5ExceptionTests.test_generator_close_cleanup_exc_states	//9rc,d}|j|y)Ncd}yrr rVs rdo_delzCExceptionTests.test_generator_del_cleanup_exc_state.<locals>.do_delsArr)rrs  r$test_generator_del_cleanup_exc_statez3ExceptionTests.test_generator_del_cleanup_exc_states	//7rc2fd}j|y)Nc^	t|jdy#t$rYywxYwNz should have raised StopIteration)rrhrrWrs rdo_nextzEExceptionTests.test_generator_next_cleanup_exc_state.<locals>.do_nexts2
>Q		<=!

s 	,,r)rrs` r%test_generator_next_cleanup_exc_statez4ExceptionTests.test_generator_next_cleanup_exc_state	>	
//8rc2fd}j|y)Ncj	|jdjdy#t$rYywxYwr)sendrhrrs rdo_sendzEExceptionTests.test_generator_send_cleanup_exc_state.<locals>.do_send%s6
>t		<=!

s&	22r)rrs` r%test_generator_send_cleanup_exc_statez4ExceptionTests.test_generator_send_cleanup_exc_state$rrcGfdd}d	t|#YnxYwt|jy)NceZdZfdZy)*ExceptionTests.test_3114.<locals>.MyObjectc.tjyr)r]r~r!s r__del__z2ExceptionTests.test_3114.<locals>.MyObject.__del__2sMMOrNrrrrr&srMyObjectr1s
$rrr )r)rrE)rrrns  @r	test_3114zExceptionTests.test_3114.sC	$	$
	HJ''	!s!%cGddt}Gddt}Gddt}		|#|$r}|}	|#|$r}|}	|#|$r}|}	|j|||j|||j|	||j|j|j	|j||j	|	j||d}~wwxYwd}~wwxYwd}~wwxYw#|$r}
|
}Yd}
~
nd}
~
wwxYw|j	||j	|j	|j	|	j|j|jy)NceZdZy)HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.ANrr rrAr>rrrceZdZy)HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.BNrr rrBr@rrrceZdZy)HExceptionTests.test_raise_does_not_create_context_chain_cycle.<locals>.CNrr rrCrBrrr)r)r1rEr9r)rrrra_rb_rc_crnr/s            r.test_raise_does_not_create_context_chain_cyclez=ExceptionTests.test_raise_does_not_create_context_chain_cycle=sM										
 
  G A
  --a3--a3--a3))!--8

ammQ7

ammQ7 	 	
 "	C		


c1

ammQ'

ammQ'!--(sf2C-C(<C%C ACB
CCC  C%%C((C--C00D5C<<Dcd}	||jt|j|jt|j|jj|jy#t$r}|}Yd}~wd}~wwxYw)Nc`	td#t$r}||_tdd}~wwxYwNrMr)rXr9rWexs rcyclezBExceptionTests.test_no_hang_on_context_chain_cycle1.<locals>.cyclehs2
# m#
#!#l"
#s
	-(-)r)r1rWr9rXr)rrrnr/s    r$test_no_hang_on_context_chain_cycle1z3ExceptionTests.test_no_hang_on_context_chain_cycle1esj	#	G	
c9-cooz:

coo113??C	C	sA33	B<BBcGddt}Gddt}Gddt}|j|5}	|#|$r>}|}	|#|$r'}|}	|#|$r}	|	}
|
|_|
d}	~	wwxYwd}~wwxYwd}~wwxYw#1swYnxYw|jj
|j|
j|j|j|j|j|
y)NceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.ANrr rrrr{rrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.BNrr rrrr}rrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle2.<locals>.CNrr rrrrrrrr)r[r9rr~)rrrrr_ar_br_crs           r$test_no_hang_on_context_chain_cycle2z3ExceptionTests.test_no_hang_on_context_chain_cycle2xs									

q
!	 R

 c	
 	 #I A c	 ()
 	 	
 	 	  	


bllA&

ammQ'

ammQ'

ammQ'seBAB
BABA>A&&A;	+A6	6A;	;A>>BBBBBcGddt}Gddt}Gddt}Gddt}Gd	d
t}|j|5}	|#|$r\}|}	|#|$rE}	|	}
	|#|$r.}|}||_	|#|$r}
|
}|}|d}
~
wwxYwd}~wwxYwd}	~	wwxYwd}~wwxYw#1swYnxYw|jj|j|j|j|j|j|j
|j|
j|j|j|y)NceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.ANrr rrrrrrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.BNrr rrrrrrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.CNrr rrrrrrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.DNrr rrDrrrrceZdZy)>ExceptionTests.test_no_hang_on_context_chain_cycle3.<locals>.ENrr rrErrrrr)rrrrrrrrrrrrr_ddrns                r$test_no_hang_on_context_chain_cycle3z3ExceptionTests.test_no_hang_on_context_chain_cycle3sb															

q
!	$R
$c	
$$#I$A
$c	$()
$"##I $ "A !A"#G$$	$	
$	$	$*	


bllA&

ammQ'

ammQ'

ammQ'

ammQ'

ammQ'sC
A&&C+C.A55B?:B:=BB7			B2	BB/B**B//B2	2B7	7B::B??CCC

Cc		td}|#td}|xYw#t$r}|}Yd}~nd}~wwxYw|j||j|jyr)rWrXr)rr9)rtevernr/s     r,test_context_of_exception_in_try_and_finallyz;ExceptionTests.test_context_of_exception_in_try_and_finallys`	
q\]	C		


c2

coor*s
!	616c@		td}|#td}|xYw#td}|xYw#t$r}|}Yd}~nd}~wwxYw|j	||j	|j
|j	|j
j
y)NrMrr)rWrXrBr)rr9)rr
roernr/s      r/test_context_of_exception_in_except_and_finallyz>ExceptionTests.test_context_of_exception_in_except_and_finallys	
q\
]QZ	C		


c2

coor*

coo1126s$
"03	AAAc			td}|#YnxYw	td}|#td}|xYw#t$r}|}Yd}~nd}~wwxYw|j||j|jyr)rXrBr)rr9)rrrrnr/s     r-test_context_of_exception_in_else_and_finallyz<ExceptionTests.test_context_of_exception_in_else_and_finallys		
 ]	

QZQZ	C		


c2

coor*s)
&&
747	AAActddddd}|jt|dd|_|jt|dd|_d	|_|jt|d
d|_|jt|dd
|_|jt|dtddddd}|jt|dd|_|jt|dd|_d	|_|jt|dd|_|jt|dd
|_|jt|dtdddd}|jt|dd|_|jt|dd|_d	|_|jt|dd
|_|jt|dy)NrxxxxxrMrrz8'baz' codec can't encode characters in position 1-4: foorz<'baz' codec can't encode character '\x78' in position 1: foolESh
MQ)EzJ'baz' codec can't encode characters in position 1-4: 965230951443685724997izK'4000' codec can't encode characters in position 1-4: 965230951443685724997izN'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: 965230951443685724997xxxxz/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)	rr4r3rrr@rrr)rus  rtest_unicode_change_attributesz-ExceptionTests.test_unicode_change_attributess
ugq!U;Q![\Q!`a'Q!mn
Q!noQ!qruh1e<Q!VWQ!XY'Q!hi
Q!ijQ!lm!&!Q6Q!RSQ!WX'Q!deQ!ghrctttf}|D],}|jt	|j|d.y)N)rrrr4r3__new__)rklassesklasss   rtest_unicode_errors_no_objectz,ExceptionTests.test_unicode_errors_no_object"s=$&8:OO	<ESu!56;	<rcGddt}Gddt|}t5}	t#|$r}|j	dYd}~n%d}~wt$rYn|j	dYnxYwdddn#1swYnxYwfd}|j|tt||jd	t|y)
NceZdZdZy)/ExceptionTests.test_badisinstance.<locals>.MetactrrU)clssubclasss  r__subclasscheck__zAExceptionTests.test_badisinstance.<locals>.Meta.__subclasscheck__-s
 l"rN)rrrr#r rrMetar,s
#rr$ceZdZy)6ExceptionTests.test_badisinstance.<locals>.MyExceptionNrr rrr/r&/rrr/)	metaclasszShould have raised KeyErrorz%exception should not be a MyExceptioncD	S#t$r}|cYd}~Sd}~wwxYwr)rP)rnrWs rrWz,ExceptionTests.test_badisinstance.<locals>.g>s$
s
!

s
	z maximum recursion depth exceeded)	rr)rrGrhr1rPrr3)rr$r/rrnr/rWs      @rtest_badisinstancez!ExceptionTests.test_badisinstance(s	#4	#	)t	

	9&	
9j 
C		ABB

9		78
	9
	9
	9	
cc>49=

8#c(Cs7B
8A5ABA5B!A53BB
cpuc@d}|tjy)NcPt}tdD]}|j}y)Ni@B)rrf__dir__)ors  rrz3ExceptionTests.test_trashcan_recursion.<locals>.fooMs(A9%
II
r)rr)rrs  rtest_trashcan_recursionz&ExceptionTests.test_trashcan_recursionHs
		rcdtz}tjdd|\}}}|j|d|j	d||j	d||j	d|y)Naif 1:
            import sys
            from _testinternalcapi import get_recursion_depth
            from test import support

            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()
            try:
                recurse(support.EXCEEDS_RECURSION_LIMIT)
            finally:
                sys.setrecursionlimit(recursionlimit)
                print('Done.')
        -Wd-crMsRecursionErrorsResourceWarningDone.)__file__r	assert_python_failurer4rrrrcoutr5s     r$test_recursion_normalizing_exceptionz3ExceptionTests.test_recursion_normalizing_exceptionWsn$HI$J%::5$MCQ

'-

(#.

h$rcd}tjd|\}}}|j|d|jd||jd|y)Nzif 1:
            import _testcapi
            try:
                raise _testcapi.RecursingInfinitelyError
            finally:
                print('Done.')
        r2rMs0RecursionError: maximum recursion depth exceededr3)r	r5r4rr6s     r-test_recursion_normalizing_infinite_exceptionz<ExceptionTests.test_recursion_normalizing_infinite_exceptionsP
%::4FCQ

I3O

h$rczd}fdfdfdtj}	|dfD]6}|j|5	||jdddd8	tj
|y#t$rY,wxYw#1swYhxYw#tj
|wxYw)Ncd}		tj|	tj||zy#t$r|dz
}YnwxYwEr)r]setrecursionlimitrP)ndepths  rset_relative_recursion_limitzUExceptionTests.test_recursion_in_except_handler.<locals>.set_relative_recursion_limitsSE))%0!!%'*	&QJEs4AAc.	ddzy#YyxYwrr )recurse_in_exceptsrrCzJExceptionTests.test_recursion_in_except_handler.<locals>.recurse_in_excepts
$!
$!#s		c.	ddzy#YxYwrr )recurse_after_exceptsrrEzMExceptionTests.test_recursion_in_except_handler.<locals>.recurse_after_excepts!
!
!"
sc2	y#YyxYwrr )recurse_in_body_and_exceptsrrGzSExceptionTests.test_recursion_in_except_handler.<locals>.recurse_in_body_and_excepts
-*,
-*,s	rF)funcz#Should have raised a RecursionError)r]getrecursionlimitr2rhrPr>)rrArecursionlimitrHrErGrCs    @@@r test_recursion_in_except_handlerz/ExceptionTests.test_recursion_in_except_handlers		+	$	#	-..0	2(,*,@B\]
I\\t\,II		"GH
II
I
!!.1*II
!!.1sG"B#
BBB'
B#	BBBBB 	B##B:cd}t5tjd|\}}}|jd|dddy#1swYyxYw)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)
        r2MemoryError)r
r	r5rr6s     r)test_recursion_normalizing_with_no_memoryz8ExceptionTests.test_recursion_normalizing_with_no_memorysL!
"	/(>>tTJLBSMM.#.	/	/	/s-AAclddlddlmfd}|}|}j||y)Nrraise_memoryerrorc	jdjS#t$r}|j}Yd}~+d}~wwxYw)Nz Should have raised a MemoryError)rhrJr	format_tb)rnrrQr	tracebacks  r
raiseMemErrorz6ExceptionTests.test_MemoryError.<locals>.raiseMemErrorsI
>!#		<=&&r**	
%__
%s,	AAA)rTrrQr4)rrUtb1tb2rQrTs`   @@rtest_MemoryErrorzExceptionTests.test_MemoryErrors0	/	+ooc"rcddl}d}d}|jt|jd|jd}|j	t|t
|j
t|t|j|j|jd|}|j|j||jd|}|j
t||Gd	d
t}|jd|||f}|j
t|||j
t|||j|j||jdd
|ddi}	|j
t|	||j|	jd|j|	jd
y)NrzThis is a test docstring.zThis is another test docstring.error1z_testcapi.error1z_testcapi.error2z_testcapi.error3)baseceZdZy)1ExceptionTests.test_exception_with_doc.<locals>.CNrr rrrr]rrrz_testcapi.error4z_testcapi.error5rrrM)rr[rUmake_exception_with_docrrr
issubclassr)rE__doc__r4rr)
rrdoc2doc4rZerror2error3rerror4error5s
          rtest_exception_with_docz&ExceptionTests.test_exception_with_docs*0+y'H'H"	$223EF

d6lD)
6956&..)223EtL.223E8>3@
6623		223Et4:A;@
6623
61-..223Er39C8E
66231%,rc
ddlmGdddfd}	||jdt|j
dy#t$r!}|j	dYd}~Gd}~wwxYw)NrrPceZdZy)3ExceptionTests.test_memory_error_cleanup.<locals>.CNrr rrrrj%rrrcL}tj|yrrr)rrrQrs rinnerz7ExceptionTests.test_memory_error_cleanup.<locals>.inner(sAQBrzMemoryError not raised)rrQrhrJassertNotEqualrr4)rrmrnrrQrs   @@@rtest_memory_error_cleanupz(ExceptionTests.test_memory_error_cleanup ss	0		
	 	0G
II./t$	,d++	,sA	B!A==BcGdddfd	|jdt|j	dy#t$r!}|jdYd}~Gd}~wwxYw)NceZdZy)6ExceptionTests.test_recursion_error_cleanup.<locals>.CNrr rrrrr:rrrcL}tj|yrrl)rrrmrs rrmz:ExceptionTests.test_recursion_error_cleanup.<locals>.inner=sAQBGrzRecursionError not raised)rhrPrnrr4)rrnrrmrs  @@@rtest_recursion_error_cleanupz+ExceptionTests.test_recursion_error_cleanup7sn		
		3G
II12t$	,d++	,sA	A<A77A<c|jt5}tjtddd|jjjtj|jy#1swYIxYwr)	r[rBoslistdirr4r4r~rENOTDIR)rrs  rtest_errno_ENOTDIRz!ExceptionTests.test_errno_ENOTDIRLsW


w
'	!2JJx 	!++U]]BLLI	!	!sA88Bc8Gdd}|}tj5}~t|j|jj
|j|j|jjdddy#1swYyxYw)NceZdZdZy)1ExceptionTests.test_unraisable.<locals>.BrokenDelctd}|)Nz
del is brokenrUrr/s  rrz9ExceptionTests.test_unraisable.<locals>.BrokenDel.__del__Us 1	rNrr rr	BrokenDelr|Ts
rr)	rcatch_unraisable_exceptionrr4
unraisablerrassertIsNotNone
exc_traceback)rrrrs    rtest_unraisablezExceptionTests.test_unraisableRsx		k

/
/
1	>RLR]]1193D3DE  !<!<=	>	>	>sA!BBc	dttfD]}|j|5	|d}|y#|$rGt5}t	j
t	jdddn#1swYnxYwYnwxYwj}|jd||jd||j|j||tur|jd|n|jd||j|jdddd#1swY"xYw)Nztest messagerz	raise excz<exception str() failed>r)rXr&r2rr]__excepthook__exc_infogetvaluerrrr)rryr/rreports     rtest_unhandledzExceptionTests.test_unhandledbs#%78	7Hh'
7<">2CI	7 <(*<f**CLLN;<<<< *

2F;

k62

h//811MM"<fEMM.&9 56!
7
7
7s>D%
/A;%A,	#	A;,A5
1A;8D%:A;;B D%%D/	cd}tddD]C}tjd||z\}}}|j|d|jd|Ey)Nzif 1:
            import _testcapi
            class C(): pass
            _testcapi.set_nomemory(0, %d)
            C()
        rMrr2)rMxrM)rfr	r5r)rrrr7r8r5s      r"test_memory_error_in_PyErr_PrintExz1ExceptionTests.test_memory_error_in_PyErr_PrintExwsXq"	/A(>>tTAXNLBSMM"h'MM.#.	/rcGddtGddtfd}|}|jd|j5|jdddy#1swYyxYw)NceZdZy)BExceptionTests.test_yield_in_nested_try_excepts.<locals>.MainErrorNrr rr	MainErrorrrrrceZdZy)AExceptionTests.test_yield_in_nested_try_excepts.<locals>.SubErrorNrr rrSubErrorrrrrc3PK	#$r	d#$rYwxYwwxYwwrr )rrsrmainz=ExceptionTests.test_yield_in_nested_try_excepts.<locals>.mainsF
k!
 
s(&####&)r)rr[r)rrcororrs   @@r test_yield_in_nested_try_exceptsz/ExceptionTests.test_yield_in_nested_try_exceptsse				y		v		$


y
)	#JJxz"	#	#	#sA00A9cfd}|}	t#t$rjt|dYnwxYwjt|dy)Nc3K	t#t$rdYnwxYwjtjdywr)rXrEr]r~r*srrWz?ExceptionTests.test_generator_doesnt_retain_old_exc2.<locals>.gs?
  

cmmo.GsA
A+ArMr)rEr4r)rrWrs`  r%test_generator_doesnt_retain_old_exc2z4ExceptionTests.test_generator_doesnt_retain_old_exc2sS	c	+	+T#Y*	+cA&s$<<cd}|jt5|}	ddzdddy#t|t|Y#xYw#1swYyxYw)Nc3Kdwrr r rrrWz1ExceptionTests.test_raise_in_generator.<locals>.gsGrrMr)r[rYr)rrWrs   rtest_raise_in_generatorz&ExceptionTests.test_raise_in_generatorsZ	


0
1	A
!		
QQ
		sA
0A
A

AFz Won't work if __debug__ is Falsecta	b|jdy#t$r<}b|j	|t|jt
|dYd}~yd}~wwxYw)Nrhello)rWAssertionErrorrhrr1r4r3r!s  rtest_assert_shadowingz$ExceptionTests.test_assert_shadowings\
#	,II*+
	.!!!^4SVW--	.s	A 2AA cGddt}	t#t$r}|}Yd}~nd}~wwxYw	|#t$rYnwxYwtdD])}	t#t$r
}Yd}~nd}~wwxYwt+y)NceZdZy)BExceptionTests.test_memory_error_subclasses.<locals>.TestExceptionNrr rr
TestExceptionrrrrrF)rJr)rfr)rrr/inst_s     rtest_memory_error_subclassesz+ExceptionTests.test_memory_error_subclassess	K			D				r	A
!!


L
	s.	,',2	>>A	A)$A))NNr>)Prrrr8ror{rrrrrrrunittest
skipUnlessr]platformrrr"r$r+r2r6r<r?rArFrIrPrrXrZrarcrrrrrrrrrrrrrrrrrrrrrrrrr)rrequires_resourcer/r9r;rKrNrXrgrortryrrrrrrrrr rrr-r-%s4RChI0'QR7"2a)F++Z%0NX035;5;I@V!$
26.*-
HE	0' 1$*
-
-2		wr><
++&+6
3+2::
8
99
&)PD&"(H-(^+7$+$#iJ<DD>Wu%&4%4%l%%",2^//*##$%-%-N%%,%%(J> 7*// #.'$
X$FG
,H
,rr-ceZdZdZdZdZy)NameErrorTestscv	ty#t$r&}|jd|jYd}~yd}~wwxYw)Nbluch)rrKr4rr~s  rtest_name_error_has_namez'NameErrorTests.test_name_error_has_names1	0	0Wchh//	0s		838c&fd}	|j
djy#j$rQtj5}tjtj
dddn#1swYnxYwYwxYw)Nchjtd5tdddy#1swYyxYw)Naaa)rrKaabr*srrSz)NameErrorTests.test_issue45826.<locals>.fs+''	59



s(1r)failureExceptionrrr]rrrrrrSr5s`  rtest_issue45826zNameErrorTests.test_issue45826sv		4
C
	


eS\\^,	$$	4((*
4c""CLLN3
4
4
4	4s'0#B%B8	BB
	BBcTd}	||j
dj|j
d|jy#t$rQtj5}tjtj
dddn#1swYnxYwYwxYw)Ncj	ty#t$r }|jdtd}~wwxYwr)nonsenserr0rY)rs rrSz1NameErrorTests.test_issue45826_focused.<locals>.fs1
* 
*  &'))
*s		2-2rrY)rYrrr]rrrrrs   rtest_issue45826_focusedz&NameErrorTests.test_issue45826_focuseds	*	4
C
	


j#,,.1

)3<<>:!	4((*
4c""CLLN3
4
4
4	4s)A

B'*%B	B'B!	B'&B'N)rrrrrrr rrrrs0-;rrceZdZdZdZdZy)AttributeErrorTestsc&td}|j|j|j|jt	}tdd|}|j|jd|j
|j|y)NzOuch!Ouchcarryr)r:rErrrr4r)rr/sentinels   rtest_attributesz#AttributeErrorTests.test_attributesskW%#((##''"8V'x@7+

cggx(rcGdd}|}	|j	t
j
|dy#t$rB}|jd|j|j||jYd}~^d}~wwxYw#t$rB}|jd|j|j||jYd}~yd}~wwxYw)NceZdZdZy)<AttributeErrorTests.test_getattr_has_name_and_obj.<locals>.ANrrrblechr rrrr%sErrr)rr:r4rrr__getattribute__rrrr/s    rtest_getattr_has_name_and_objz1AttributeErrorTests.test_getattr_has_name_and_obj$s		c	+II	+##C1		+Wchh/S#''**	+
	+Wchh/S#''**	+s,7B	B8A==B	C8CCcGdd}|}	|jy#t$rB}|jd|j|j||jYd}~yd}~wwxYw)NceZdZdZy)GAttributeErrorTests.test_getattr_has_name_and_obj_for_method.<locals>.Acyrr r*s rrzMAttributeErrorTests.test_getattr_has_name_and_obj_for_method.<locals>.A.blech6srNrr rrrr5s
rrr)rr:r4rrrs    r(test_getattr_has_name_and_obj_for_methodz<AttributeErrorTests.test_getattr_has_name_and_obj_for_method4s^		c	+IIK	+Wchh/S#''**	+s$	A/8A**A/N)rrrrrrr rrrrs	)+ 
+rrc$eZdZdZdZdZdZy)ImportErrorTestscZtd}|j|j|j|jtdd}|j	|jd|j|jtdd}|j	|jd|j|jtddd}|j	|jd|j	|jdd}|jt|5tdd	
ddd|jt|5tddd	ddd|jt|5tdd
d	ddd|jt|5td	
ddd|jt|5tdd	ddddy#1swYxYw#1swYxYw#1swYzxYw#1swY[xYw#1swYyxYw)Ntest
somemodulersomepathpathsomename)rrz8'invalid' is an invalid keyword argument for ImportErrorkeyword)invalidr)rrr)rrT)ranother)rCrErrr4rrW)rr/rss   rrz ImportErrorTests.test_attributesEs&!#((##((#&|4<0#((#&z2:.#((#&z
C:.:.H

#
#Is
3	3	2	3
#
#Is
3	@VY?	@
#
#Is
3	@VY?	@
#
#Is
3	+	*	+
#
#Is
3	A	4@	A	A	3	3	@	@	@	@	+	+	A	As<(G1G=H	.
HH!1G:=H	HH!H*ctddd}|j|jd|j|jd|j|jd|j|j
d|j
|j|jd|j|jd|j|jd|j|j
dy)Nrrrrrrr )rCr4rrsrrrr~s  rtest_reset_attributesz&ImportErrorTests.test_reset_attributesgs&vF;9-&)6*6*	2&$'4(4(rctdtfd5d}t|}|jt	|t	|dddy#1swYyxYw)NrT)quietsabc)rBytesWarningrCr4r3)rargr/s   rtest_non_str_argumentz&ImportErrorTests.test_non_str_argumentusM
R.d
;	1Cc"CSXs3x0	1	1	1s2AActtdtdtddfD]}tdi|}ttjdzD]}tj
tj||}|j|jd|j|jd|j|j|j|j|j|jtjtjfD]}||}|j|jd|j|jd|j|j|j|j|j|jy)	NrrrrrrrMr)rrCrfr
rrbrr4rrsrrcopydeepcopy)rrorigprotor/rs      rtest_copy_picklez!ImportErrorTests.test_copy_pickle|sPv,,*=?	6F00Dv66:;
6ll6<<e#<=  95  &1  4995  4995
6YY

-
6g  95  &1  4995  4995
6	6rN)rrrrrrrr rrrrCs AD)16rrc0eZdZdZdZdZdZdZdZy)SyntaxErrorTestscjdtdfdtdfdtdfdtdfdtd	fd
td	fdtd	fdtd	fd
tdfg	}|D]$\}}|j|5	td|y#t$rz}tj5}tjtjdddn#1swYnxYw|j|j|}Yd}~nd}~wwxYw	ddd#1swYxYw)N)bad.pyrMrabcdefgrMrz
               File "bad.py", line 1
                 abcdefg
                  ^^^^^
             SyntaxError: bad bad
             )rrMrrrMrz
               File "bad.py", line 1
                 abcdefg
                  ^
             SyntaxError: bad bad
             )rrMrrrM)rrMrrrMrz
               File "bad.py", line 1
                 abcdefg
                    ^
             SyntaxError: bad bad
             )rrMrrMrzn
               File "bad.py", line 1
                 abcdefg
             SyntaxError: bad bad
             )rrMrrrM)rrMrrrMr)rrMrrrMrrrMrrrMdz
               File "bad.py", line 1
                 abcdefg
                  ^^^^^^
             SyntaxError: bad bad
             )rbad bad)
rr2rQrrr]rrrr)rcasesrrr/r5
the_exceptions       rtest_range_of_offsetsz&SyntaxErrorTests.test_range_of_offsetss/

/

0

/

1

1

/

/

1

MN
^$	(ND(4(
((%i66	(#( 002<c**CLLN;<<<MM(CLLN;$'M	("
(
(
(sH	D)B	D"D6%C$		D$C-
))DD)DD))D2	c"d}	ttdd5}|j|dddtjdddt\}}}|jdj
}|j|d	d
|j|ddttd
}	ttdd5}|j|dddtjdddt\}}}|jdj
}|j|d	d|j|ddtty#1swY*xYw#ttwxYw#1swYxYw#ttwxYw)NuU# -*- coding: cp437 -*-
"¢¢¢¢¢¢" + f(4, x for x in range(1))
r=cp437r?r1-Xutf8r>u@    "¢¢¢¢¢¢" + f(4, x for x in range(1))rz-                          ^^^^^^^^^^^^^^^^^^^z# -*- coding: ascii -*-

(
rz    (z    ^)	r^rwriter	r5r
splitlinesr4r
)rrtestfiler7r8r5s      rtest_encodingszSyntaxErrorTests.test_encodingssX
M			fcG4
'v&
'(>>udFTZBS**W%002CSW&hiSW&UV6N2		fcG4
'v&
'(>>udFTZBS**W%002CSWg.SWg.6N+
'
'
6N

'
'
6NsGEEA1E+E==E1A1E=EEE.1E:6E==Fc`	ttd5}|jddddtjdddt\}}}|jdj
}|jd|dtty#1swYmxYw#ttwxYw)	Nbwr1rrr>z8SyntaxError: Non-UTF-8 code starting with '\x89' in filer)	r^rrr	r5rrrr
)rrr7r8r5s     r
test_non_utf8zSyntaxErrorTests.test_non_utf8s	fd#
(xw'
((>>udFTZBS**W%002CMMUWZ[]W^_6N
(
(
6Ns"BBABBBB-cd}td|}|\}}}}}}|j||j|j||j|j||j|j||j
|j||j|j||j|jd|jy)Nrr	rQr4rrrrrrrs)	rrrrrrerrorrrs	         rtest_attributes_new_constructorz0SyntaxErrorTests.test_attributes_new_constructors2#It4
BF?&&%Z=#9#9:!5!56]%=%=>!5!56]%=%=>
 2 23M$5$56rcd}td|}|\}}}}|j||j|j||j|jd|j|j||j
|jd|j|j||j|jd|jy)N)rrMrrrr
)rrrrrrrs       rtest_attributes_old_constructorz0SyntaxErrorTests.test_attributes_old_constructors*#It4
*.'&&%=#9#9:!5!56}778!5!56}778
 2 23M$5$56rcd}|jttd|d}|jttd|d}|jttd|y)N)rrMrr)rrMrrrrr)rrMrrrM)r[rWrQrrs  rtest_incorrect_constructorz+SyntaxErrorTests.test_incorrect_constructor+sM)[)TB+)[)TB-)[)TBrN)	rrrrrrrrrr rrrrs#X(t:

7
7CrrceZdZdZy)TestInvalidExceptionMatcherc|jt5	t#d$rYnwxYw	dddn#1swYnxYw|jt5	t#tdf$rYnwxYw	dddy#1swYyxYw)Nr)r[rWrXr*s r'test_except_star_invalid_exception_typezCTestInvalidExceptionMatcher.test_except_star_invalid_exception_type7s


y
)	
  

				

y
)	
  #

				sF3&3&3<A7AA*'A7)A**A77BN)rrrrr rrrr6srrcNeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
y)
PEP626Testsc	||jdg}j}|r[|j}|j|jdn"|j|jjz
|j}|r[|jt||y#t$r}|j}Yd}~d}~wwxYw)Nr5)rhr)rrrrf_linenorco_firstlinenor4tuple)rrSrrtlinesframes       rlineno_after_raisezPEP626Tests.lineno_after_raiseGs	-
C
II+,
IIJJELL.u||:::
		A
	
ux0	!  A	!sB!!	C*B;;Cc.d}|j|dy)Ncddzyrr r rrsimplez:PEP626Tests.test_lineno_after_raise_simple.<locals>.simpleZs
aCrrMr)rr"s  rtest_lineno_after_raise_simplez*PEP626Tests.test_lineno_after_raise_simpleYs		
*rc.d}|j|dy)Nc(	ddzy#ddzYyxYwrr r rr	in_exceptz@PEP626Tests.test_lineno_after_raise_in_except.<locals>.in_except`s
!
!srr#)rr's  r!test_lineno_after_raise_in_exceptz-PEP626Tests.test_lineno_after_raise_in_except_s		
	1-rc.d}|j|dy)Nc<	ddzy#t$r
}Yd}~yd}~wwxYwr)rWrs rother_exceptz@PEP626Tests.test_lineno_after_other_except.<locals>.other_exceptis!
!

s	rr#)rr+s  rtest_lineno_after_other_exceptz*PEP626Tests.test_lineno_after_other_excepths	
	
a0rc.d}|j|dy)NcF	ddzy#t$r}ddzYd}~yd}~wwxYwrr(rs rin_named_exceptz@PEP626Tests.test_lineno_in_named_except.<locals>.in_named_exceptqs(
!
!
s	  rr#)rr/s  rtest_lineno_in_named_exceptz'PEP626Tests.test_lineno_in_named_exceptps		
3rc.d}|j|dy)Nc	ddzy#wxYwrr r rrin_tryz.PEP626Tests.test_lineno_in_try.<locals>.in_tryzs
!s
rr#)rr3s  rtest_lineno_in_tryzPEP626Tests.test_lineno_in_tryys	
	
*rc.d}|j|dy)Nc&		ddzy#ddzwxYwrr r rrin_finally_normalzDPEP626Tests.test_lineno_in_finally_normal.<locals>.in_finally_normals"
!!srr#)rr7s  rtest_lineno_in_finally_normalz)PEP626Tests.test_lineno_in_finally_normal		
 115rc.d}|j|dy)Nc.	ddzddzy#ddzwxYwrr r rrin_finally_exceptzDPEP626Tests.test_lineno_in_finally_except.<locals>.in_finally_excepts&
!!!s
rr#)rr<s  rtest_lineno_in_finally_exceptz)PEP626Tests.test_lineno_in_finally_exceptr9rcHGddfd}|j|dy)NceZdZdZdZy)0PEP626Tests.test_lineno_after_with.<locals>.Noopc|Srr r*s rrvz:PEP626Tests.test_lineno_after_with.<locals>.Noop.__enter__rwrcyrr rs  rr|z9PEP626Tests.test_lineno_after_with.<locals>.Noop.__exit__srNr}r rrNoopr@s

rrCcJ5ddz	dddy#1swYyxYwrr )rCsr
after_withz6PEP626Tests.test_lineno_after_with.<locals>.after_withs'
!


s"rr#)rrErCs  @rtest_lineno_after_withz"PEP626Tests.test_lineno_after_withs$		
		

A.rcd}|j|d|jjd|_|j|dy)Ncddzyrr r rrrSz8PEP626Tests.test_missing_lineno_shows_as_none.<locals>.fs	
aCrrMs)co_linetable)r__code__r)rrSs  r!test_missing_lineno_shows_as_nonez-PEP626Tests.test_missing_lineno_shows_as_nonesA	1%ZZ''5T'U
4(rcJGddfd}|j|ddy)NceZdZdZdZy)CPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFailsc|Srr r*s rrvzMPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFails.__enter__rwrctrrUrs  rr|zLPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.ExitFails.__exit__s  rNr}r rr	ExitFailsrNs

!rrQcH5ddzdddy#1swYyxYwrr )rQsrrEzDPEP626Tests.test_lineno_after_raise_in_with_exit.<locals>.after_withs$
!


s!rMr#)rrErQs  @r$test_lineno_after_raise_in_with_exitz0PEP626Tests.test_lineno_after_raise_in_with_exits&	!	!		

Aq1rN)rrrrr$r(r,r0r4r8r=rFrKrSr rrrrEs91$+.14+66
/)
2rr__main__)(rrvr]rr
rrtextwraprtest.supportrrrrrr	r
test.support.import_helperrtest.support.os_helperrr
test.support.warnings_helperrrrr)rr"r&TestCaser-rrrrrrrrr rr<module>r[s	

///517YI
++GX&&GT6$;X&&$;R&+(++&+VJ6x((J6XdCx((dCN("3"3k2(##k2ZzHMMOr