³ò ¢l‡Jc @s1dZddkZddkZddkZdddddgZgZdZhZdd d „Z dddd „Z dd „Z d „Z de dddd„Ze ddd„Zd„Zdefd„ƒYZd„Zd„Zd„Zd„Zeeiƒeddedd ƒeddedd ƒdS(s&Python part of the warnings subsystem.iÿÿÿÿNtwarnt showwarningt formatwarningtfilterwarningst resetwarningstdefaultic Cs{t|tƒo |i}n|d jo t}nt|tƒpt‚yti|ƒ}Wn"t j oti }d}nX|i }|i }d|jo|d}nd}|i dƒ}|o.|iƒ}|id ƒo|d }qInP|djo1ytid }Wq8tj o d}q8Xn|p |}n|id hƒ} t|||||| |ƒd S( s:Issue a warning, or maybe ignore it or raise an exception.it__name__st__file__s.pycs.pyoiÿÿÿÿt__main__it__warningregistry__N(s.pycs.pyo(t isinstancetWarningt __class__tNonet UserWarningt issubclasstAssertionErrortsyst _getframet ValueErrort__dict__t f_globalstf_linenotgettlowertendswithtargvtAttributeErrort setdefaultt warn_explicit( tmessagetcategoryt stackleveltcallertglobalstlinenotmoduletfilenametfnltregistry((s/sys/lib/python/warnings.pyRs<           c Cs…|djo6|pd}|diƒdjo|d }qCn|djo h}nt|tƒot|ƒ}|i}n|}||ƒ}|||f}|i|ƒodSnx’tD]„} | \} } } } }| djp| i|ƒoLt || ƒo<| djp| i|ƒo|djp ||joPqÃqÃWt } | djod||iýÿÿÿs.pyitignoreiterrortoncetalwaysR$Rs1Unrecognized action (%r) in warnings.filters: %s(R RR R tstrR RtfilterstmatchRt defaultactiont linecachetgetlinest onceregistryt RuntimeErrorR(RRR%R#R$R'tmodule_globalsttexttkeytitemtactiontmsgtcattmodtlntoncekeytaltkey((s/sys/lib/python/warnings.pyR@sb                   c CsT|djo ti}ny |it||||ƒƒWntj onXdS(s7Hook to write a warning to a file; replace if you like.N(R RtstderrtwriteRtIOError(RRR%R#tfile((s/sys/lib/python/warnings.pyR€s    cCsRd|||i|f}ti||ƒiƒ}|o|d|d}n|S(s.Function to format a warning the standard way.s%s:%s: %s: %s s s (RR0tgetlinetstrip(RRR%R#tstline((s/sys/lib/python/warnings.pyR‰s ticCsddk}|djptd |f‚t|tƒp td ‚t|ttifƒp td ‚t|tƒp td ‚t|tƒp td ‚t|t ƒo |djp td‚||i ||i ƒ||i |ƒ|f}|ot i |ƒnt id|ƒdS(s†Insert an entry into the list of warnings filters (at the front). Use assertions to check that all arguments have the right type.iÿÿÿÿNR)R(R+RR$R*sinvalid action: %rsmessage must be a stringscategory must be a classs#category must be a Warning subclasssmodule must be a stringislineno must be an int >= 0(serrorsignoresalwayssdefaultsmodulesonce(treRR t basestringttypettypest ClassTypeRR tinttcompiletIR-tappendtinsert(R8RRR$R#RPRHR7((s/sys/lib/python/warnings.pyR‘s  cCs†|d jptd|f‚t|tƒo |djp td ‚|d |d |f}|oti|ƒntid|ƒd S( sƒInsert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. R)R(R+RR$R*sinvalid action: %rislineno must be an int >= 0N(serrorsignoresalwayssdefaultsmodulesonce(RR RMR R-RPRQ(R8RR#RPR7((s/sys/lib/python/warnings.pyt simplefilter§s cCs gt(dS(sAClear the list of warning filters, so that no filters are active.N(R-(((s/sys/lib/python/warnings.pyR¶st _OptionErrorcBseZdZRS(s,Exception used by option processing helpers.(Rt __module__t__doc__(((s/sys/lib/python/warnings.pyRSºscCsNxG|D]?}yt|ƒWqtj o}tidI|IJqXqWdS(NsInvalid -W option ignored:(t _setoptionRSRR?(targstargR9((s/sys/lib/python/warnings.pyt_processoptions¿s c Csoddk}|idƒ}t|ƒdjotd|fƒ‚nx%t|ƒdjo|idƒqHWg}|D]}||iƒqx~\}}}}} t|ƒ}|i|ƒ}t|ƒ}|i|ƒ}|o|d}n| oZy't | ƒ} | djo t ‚nWqUt t fj otd| fƒ‚qUXnd} t ||||| ƒdS( Niÿÿÿÿt:istoo many fields (max 5): %rRGt$isinvalid lineno %r( RHtsplittlenRSRPRDt _getactiontescapet _getcategoryRMRt OverflowErrorR( RXRHtpartst_[1]RER8RRR$R#((s/sys/lib/python/warnings.pyRVÇs. /    cCsd|pdSn|djodSnx&d D]}|i|ƒo|Sq+q+Wtd|fƒ‚dS( NRtallR+R(R$R*R)sinvalid action: %r(sdefaultsalwayssignoresmodulesonceserror(t startswithRS(R8ta((s/sys/lib/python/warnings.pyR^âs c Cs>ddk}|ptSn|id|ƒo=yt|ƒ}Wqtj otd|fƒ‚qXn©|idƒ}|| }||d}yt|dd|gƒ}Wn&t j otd|fƒ‚nXyt ||ƒ}Wn&t j otd|fƒ‚nXt |tƒptd|fƒ‚n|S(Niÿÿÿÿs^[a-zA-Z0-9_]+$sunknown warning category: %rt.isinvalid module name: %rsinvalid warning category: %r( RHR R.tevalt NameErrorRStrfindt __import__R t ImportErrortgetattrRR(RRHR:tiR$tklasstm((s/sys/lib/python/warnings.pyR`ìs,  R(RRP(RURRKR0t__all__R-R/R2R RRRRR RRRRt ExceptionRSRYRVR^R`t warnoptionstPendingDeprecationWarningt ImportWarning(((s/sys/lib/python/warnings.pyss.   )?