Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 52.14.242.56
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_exceptions.pyc
�
?��cc@s�ddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZddlm
Z
defd��YZdejfd��YZdefd	��YZd
ejfd��YZd�Zed
kr�e�ndS(i����N(tTESTFNtunlinktrun_unittesttcaptured_stderrtcheck_warningstcpython_only(tignore_deprecation_warningstBrokenStrExceptioncBseZd�ZeZRS(cCstd��dS(Nsstr() is broken(t	Exception(tself((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt__str__
s(t__name__t
__module__R
t__repr__(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRs	tExceptionTestscBs�eZd�Zd�Zd�Zd�Zed��Zd�Ze	d��Z
d�Zd�Ze	d	��Z
e	d
��Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsUy*ddlm}ddl}||�Wn$tk
rP}|jd|�nXdS(Ni����(treloadsreloading exceptions: %s(timpRt
exceptionstImportErrortfail(R	RRte((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt
testReloadscCs�y
|d�Wn|k
r.}t|�}nXy|d��Wn|k
r`}t|�}nX|j||�|j|j|�dS(Ntspam(tstrtassertEqualR(R	texctexcnameterrtbuf1tbuf2((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pytraise_catchs
cBs/|jed�|jeeed�|jed�eed�}|j�eed�}ej	}z.y|e_	e
�}Wnek
r�nXWd|e_	|j�ee�X|jed�|jeedd�|je
d�|je
ed	�|jed
�g}|je|jd�|jed�i}|je|jd
�|jed�|jed�|jed�y
e}Wnek
r�nX|jed�d}xed�D]}||7}q�W|jed�|jed�yddUWnek
rnX|jed�|jed�|jed�|jed�|jeejd�|jed�ygd!Wnek
r�nX|je d�|je e!d�|je"d�ydd}Wne"k
r�nX|je#d �ydd}Wne#k
r*}nXdS("NtAttributeErrortundefined_attributetEOFErrortwtrtIOErrorsthis file does not existRtundefined_modulet
IndexErrori
tKeyErrortkeytKeyboardInterrupttMemoryErrort	NameErrort
OverflowErrorii�tRuntimeErrortSyntaxErrors/
tIndentationErrortTabErrortSystemErrort
SystemExitit	TypeErrort
ValueErrori'tZeroDivisionErrorR(($RRtassertRaisestgetattrtsysR!topenRtclosetstdint	raw_inputRR$Rt
__import__R&t__getitem__R'R)R*R+tundefined_variableR,trangeR-R.R/R0R1R2texitR3R4tchrR5R(R	tfpt	savestdintxtdummyR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestRaising+s�
		

	





cs[�fd�}d}tjjd�s7||d�nd}||d�|dd�dS(Ncsgyt|dd�Wn?tk
rU}|j|krc�jd||jf�qcnX�jd�dS(Ns
<fragment>texecsexpected %s, got %ss"failed to get expected SyntaxError(tcompileR.tmsgR(tsrcRJR(R	(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pytckmsg�s!s\while 1:
            try:
                pass
            finally:
                continuetjavas0'continue' not supported inside 'finally' clausesHif 1:
        try:
            continue
        except:
            passs'continue' not properly in loops	continue
(R8tplatformt
startswith(R	RLts((R	s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestSyntaxErrorMessage|s

cs^ddd��Y���fd�}��fd�}tjjd�sZ|�|�ndS(NtBadExceptioncBseZd�ZRS(cSs
td�dS(Nscan't instantiate BadException(R-(tself_((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt__init__�s(RRRT(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRR�scs�ddl}y|j�d�Wnktk
r�}tj�\}}}|jj}�j|jd��j	|j
jdtj
d��nX�jd�dS(Ni����it
test_capi1ttest_exceptionstpysExpected exception(t	_testcapitraise_exceptionR3R8texc_infottb_frametf_codeRtco_namet
assertTruetco_filenametendswithtostextsepR(RXRRttbtco(RRR	(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRU�s(cs�ddl}y|j�d�Wn�tk
r�}tj�\}}}|jj}�j|jd��j	|j
jdtj
d��|jjj}�j|jd�nX�jd�dS(Ni����iRTRVRWt
test_capi2sExpected exception(RXRYR-R8RZR[R\RR]R^R_R`RaRbtf_backR(RXRRRcRdtco2(RRR	(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRe�s$RM((R8RNRO(R	RURe((RRR	s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestSettingException�scCs�ytWntk
rntX|jttd��d�|jttdd��d�|jtdd�jd�|jtdd�jd�dS(Ni�t1001tmessages[Error 1001] messagei(tWindowsErrorR+RRterrnotwinerror(R	((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_WindowsError�s
c
Cs.td+idd6d,d6ftd-idd6d.d6ftd/idd6d0d6ftd1idd6d2d6ftd3idd6d4d6dd6ftd5idd6d6d6dd6dd6dd	6ftd7idd6d8d6dd6dd6d
d	6ftd9idd6d:d6dd6dd6d
d	6ftd;idd6d<d6ftd=idd6d>d6dd	6d
d6dd6ftd?idd6d@d6dd6dd	6dd6ftdAidd6dd6dd6dd6dd6dd6dd6ftdBidd6dCd6dd6dd6dd6dd6dd6dd6ftddDfidd6dd6dd6ddEfd6dd6dd6dd6dd6ftdFidd6dd6dGd6dd6dd6dd6dd6dd6ftdHidd6dId6ftdJidd6dKd6dd6dd6dd 6dd!6ftdLidd6dMd6dd6d"d6dd 6dd!6ft	dNidd6dOd6d#d6d$d!6dd 6dd%6fg}yD|j
tdPidd6dQd6dd	6dd&6d'd6dd6f�Wntk
r�nXxj|D]b\}}}y||��Wq�tk
r%}t
|�|k	r
�n|jt
|�jd(�t|�}xJ|D]B}|jtt||��t||�d)t|�|f�q9Wx�ttfD]�}x�t|jd�D]t}	|j|j||	��}
xP|D]H}tt|
|��}t||�}|j||d*||f�q�Wq�Wq�Wq�Xq�WdS(RNtRjtargsitfootcodetfilenameRltstrerrortbartbaztquuxterrnoStrtstrErrorStrtfilenameStrRJttexttlinenotoffsettprint_file_and_linetmsgStrt	linenoStrt	offsetStrttextStrtprint_file_and_lineStrtasciiuaisordinal not in rangetencodingtobjecttstarttreasons�uあtouchtendRmiRsexception "%s", attribute "%s"spickled "%r", attribute "%s"(((i(i(Rq(Rq(Rqi(Rqi(Rq(Rq(Rq(Rq(RqRu(RqRu(RqRuRv(RqRu(RqRuRvRw(RqRuRvRw(RxRyRz(RxRy(iRyRz(iRy((R(R(RzR�R�R�(RzR�R�R�(RRzR�R�R�R�(RRzR�R�R�R�(((R�uaiisordinal not in range(R�uaiisordinal not in range(R�s�iisordinal not in range(R�s�iisordinal not in range(uあiiR�(uあiiR�(iRyRz(iRy(t
BaseExceptionR2R$tNonetEnvironmentErrorR.tUnicodeErrortUnicodeEncodeErrortUnicodeDecodeErrortUnicodeTranslateErrortappendRkR+ttypeRRRtreprR7tpickletcPickleR@tHIGHEST_PROTOCOLtloadstdumps(
R	t
exceptionListRRptexpectedRRPtcheckArgNametptprotocoltnewtgottwant((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestAttributes�s�








cCsWtd�}tdtf��}|j|jd�WdQX|jt|j�d�dS(NRqs:BaseException.message has been deprecated as of Python 2.6i(R�RtDeprecationWarningRRjtlentwarnings(R	RR"((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestDeprecatedMessageAttribute9s
cCs�td�}d|_tdt��}|j|jd�WdQX|jt|j�d�|`|jt��|jWdQXdS(NRqRutquieti(	R�RjRtTrueRR�R�R6R(R	RR"((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestRegularMessageAttributeBs	cCs�td�}td�}d|_xjttfD]\}|j|j|��}|j|jd�|j|j|��}|j|jd�q.WdS(NRqRu(RRjR�R�R�R�R(R	RtfR�tepRC((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestPickleMessageAttributeOs	cCs;d}t|�}|j||�|j|j|�dS(Niii(iii(R�RRp(R	RpR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestSlicing[scCsR|jttdd�dtfd��Y}|dd�}|j|jd�dS(NtaitDerivedExceptioncBseZd�ZRS(cSstj|�||_dS(N(R�RTt	fancy_arg(R	R�((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRTjs
(RRRT(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR�isR�i*(R6R3R�RR�(R	R�RE((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestKeywordArgsdsc	s��fd��|jt���fd��t��Dy��Wn$tk
rVn!|jd�nX|jd�WdQXdS(Ncs��S(N(((R�(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR�rscs$y��SWntk
rdSXdS(Ni����(R4((tg(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR�vs
sShould have raised KeyError(R6R-RR(R	((R�R�s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestInfiniteRecursionqs	

cCsu|jtt��|jtt��|jttd���|jttd���|jttd���dS(NR�uauá(R^RRtunicode(R	((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestUnicodeStrUsage�s
cCs�tddddd�}|jt|�d�d|_|jt|�d�d|_d	|_|jt|�d
�d|_|jt|�d�d
|_|jt|�d�tddddd�}|jt|�d�d|_|jt|�d�d|_d	|_|jt|�d�d|_|jt|�d�d
|_|jt|�d�tdddd�}|jt|�d�d|_|jt|�d�d|_d	|_|jt|�d�d
|_|jt|�d�dS(NRvuxxxxxiiRqs8'baz' codec can't encode characters in position 1-4: foois='baz' codec can't encode character u'\x78' in position 1: foolESh
MQ)EsJ'baz' codec can't encode characters in position 1-4: 965230951443685724997i�sK'4000' codec can't encode characters in position 1-4: 965230951443685724997i�sN'4000' codec can't encode characters in position 1000-4: 965230951443685724997txxxxxs3'baz' codec can't decode bytes in position 1-4: foos5'baz' codec can't decode byte 0x78 in position 1: foosE'baz' codec can't decode bytes in position 1-4: 965230951443685724997sF'4000' codec can't decode bytes in position 1-4: 965230951443685724997sI'4000' codec can't decode bytes in position 1000-4: 965230951443685724997uxxxxs/can't translate characters in position 1-4: foos4can't translate character u'\x78' in position 1: foosAcan't translate characters in position 1-4: 965230951443685724997sDcan't translate characters in position 1000-4: 965230951443685724997(	R�RRR�R�R�R�R�R�(R	tu((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttestUnicodeChangeAttributes�s>														cCsCtttf}x-|D]%}|jt|j|��d�qWdS(NRo(R�R�R�RRt__new__(R	tklassestklass((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_unicode_errors_no_object�s
c	sdtfd��Y�dtf�fd��Y}t��g}y
t��WnC|k
rm}|jd�n1tk
r}n!|jd�nX|jd�WdQXt��T}�fd����\}}}|j|tk|�|jdt|��WdQXdS(	NtMetacBseZd�ZRS(cSs
t��dS(N(R4(tclstsubclass((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt__subclasscheck__�s(RRR�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��stMyExceptioncseZ�ZRS((RRt
__metaclass__((R�(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��ss%exception should not be a MyExceptionsShould have raised KeyErrorcs*y��SWntk
r%tj�SXdS(N(R-R8RZ((R�(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s
s maximum recursion depth exceeded(	R�RRR'RR^R-tassertInR(R	R�tstderrRtvRc((R�R�s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_badisinstance�s"

cCs6dtfd��Y}|jt��|�WdQXdS(NR�cBseZd�ZRS(cWst�S(N(R�(R�Rp((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s(RRR�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s(RR6R3(R	R�((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt!test_new_returns_invalid_instance�scCsFytstd��Wn)tk
rA}|jt|�d�nXdS(Nis(3,)(i(tFalsetAssertionErrorRR(R	R((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_assert_with_tuple_arg�scsAdtf�fd��Y}t|d���d�_�`dS(NtNastycseZ�fd�ZRS(cs
�`dS(N(Rj(Rj(R(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt__del__�s(RRR�((R(s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��sRJ((RR4RpRj(R	R�((Rs;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_bad_exception_clearing�s	(RRRRRGRQRRhRnRR�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRs(	
		Q	'	
j			
		
				%		!			tExcWithOverriddenStrcBs eZdZd�Zd�ZRS(s|Subclass of Exception that accepts a keyword 'msg' arg that is
    returned by __str__. 'msg' won't be included in self.argscOs/|jd�|_tt|�j||�dS(NRJ(tpopRJtsuperR�RT(R	Rptkwargs((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyRT�scCs|jS(N(RJ(R	((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR
s(RRt__doc__RTR
(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s	tTestSameStrAndUnicodeMsgcBsweZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ed	��Zd
�Z
d�ZRS(sBunicode(err) should return the same message of str(err). See #6108cCs6|jt|�|�|jt|�t|��dS(s>Helper function that checks if str(exc) == unicode(exc) == msgN(RRR�(R	RRJ((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pytcheck_same_msgsc
Cs�tdd�tdd�td�td	d
ddd�td	d
ddd�g}x*|D]"}|jt|�t|��qXWdS(s&Check same msg for built-in exceptionssinvalid syntaxs<string>iis2+*3isNo such file or directorys both should have the same quotesR�sàisordinal not in range(128)uሴN(s<string>iis2+*3(R.R$R'R�R�RRR�(R	Rt	exception((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_builtin_exceptions
s	
cCs|jt�d�dS(s(Check same msg for Exception with 0 argsRoN(R�R(R	((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_0_argsscCsfx'dD]}|jtd|�|�qWtdd�}|jtt|�|jt|�d�dS(s@Check same msg for exceptions with 0 args and overridden __str__RqufooRJufööN(Rqufoo(R�R�R6R�RRR�(R	RJR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt#test_0_args_with_overridden___str__$s

cCs`x$dD]}|jt|�|�qWtd�}|jtt|�|jt|�d�dS(s(Check same msg for Exceptions with 1 argRqufooufööN(Rqufoo(R�RR6R�RRR�(R	targR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt
test_1_arg1s

cCslx*dD]"}|jtdd|�|�qWtddd�}|jtt|�|jt|�d�dS(s?Check same msg for exceptions with overridden __str__ and 1 argRqufooR�RJufööN(Rqufoo(R�R�R6R�RRR�(R	RJR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt"test_1_arg_with_overridden___str__=s

 cCs@ddd
g}x*|D]"}|jt|�t|��qWd
S(s,Check same msg for Exceptions with many argsiRqiufooRuiufööubarRvN(iRq(iufooRu(iufööubarRv(R�RR�(R	targslistRp((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_many_argsJs
	
cCs~x6d	D].}tdddd|�}|j||�qWtddddd�}|jtt|�|jt|�d�dS(
sCCheck same msg for exceptions with overridden __str__ and many argsRqufootarg1uarg2ufööRJuarg3N(Rqufoo(R�R�R6R�RRR�(R	RJR((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt&test_many_args_with_overridden___str__Us
	c
Cs�ddl}d}d}|jt|jd�|jd�}|jt|�t�|jt|t��|j	|j
�|jd|�}|j|j
|�|jdd|�}|jt||��d	tfd
��Y}|jd|||f�}|jt||��|jt||��|j|j
|�|jdd
|idd6�}	|jt|	|��|j|	j
d�|j|	j
d
�dS(Ni����sThis is a test docstring.sThis is another test docstring.terror1s_testcapi.error1s_testcapi.error2s_testcapi.error3tbasetCcBseZRS((RR(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR�}ss_testcapi.error4s_testcapi.error5RoiR�(RXR6R1tmake_exception_with_doctassertIsR�R^t
issubclassRtassertIsNoneR�RR�R�(
R	RXtdoc2tdoc4R�terror2terror3R�terror4terror5((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_exception_with_docds2	cCs(ddd��Y}d|fd��Y}ddd��Y}x�|||fD]�}|�}t��
}~WdQX|j�}|j|d�||kr�|jd|�n|jd	|�||kr�|jd
|�|jd|�n |jd|�|jd
|�|j|jd��qLWdS(Nt	BrokenDelcBseZd�ZRS(cSstd�}|�dS(Ns
del is broken(R4(R	R((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s(RRR�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��st
BrokenReprcBseZd�ZRS(cSstd��dS(Nsrepr() is broken(R(R	((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR
�s(RRR
(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��stBrokenExceptionDelcBseZd�ZRS(cSst�}|�dS(N(R(R	R((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��s	(RRR�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR��ssException.* ignoreds<object repr() failed>R�Rs<exception repr() failed>R4s
del is brokens
(((RtgetvaluetassertRegexpMatchesR�R^R`(R	R�R�R�t
test_classtobjR�treport((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_unraisable�s$		cCs�x�ttfD]�}y|d�}|�Wn6|k
rat��}tjtj��WdQXnX|j�}|jd|�|jd|�|j|j|�|tkr�|jd|�n|jd|�|j	|j
d��q
WdS(Nstest messagestest_exceptions.pys	raise excs<exception str() failed>s
(R4RRR8t__excepthook__RZR�R�RR^R`(R	texc_typeRR�R�((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyttest_unhandled�s

(RRR�R�R�R�R�R�R�R�R�RR�R�R�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyR�s				
		
		(	$cCsttt�dS(N(RRR�(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt	test_main�st__main__(RaR8tunittestR�R�ttest.test_supportRRRRRRttest.test_pep352RRRtTestCaseRR�R�R�R(((s;/usr/local/python-2.7/lib/python2.7/test/test_exceptions.pyt<module>s.��
�	
© 2025 GrazzMean