³ò ¢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 Csdt|tƒo |i}n|d jo t}nyti|ƒ}Wn"tj oti}d}nX|i }|i }d|jo|d}nd}|i dƒ}|o.|i ƒ}|i d ƒo|d }q2nP|djo1ytid }Wq!tj o d}q!Xn|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 UserWarningtsyst _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 Rtfilterstmatcht issubclasst 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 (RR/tgetlinetstrip(RRR#R!tstline((s/sys/lib/python/warnings.pyR‰s ticCseddk}||i||iƒ||i|ƒ|f}|oti|ƒntid|ƒ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ÿÿÿÿNi(tretcompiletIR+tappendtinsert(R7RRR"R!RJRGR6((s/sys/lib/python/warnings.pyR‘s  cCsA|d|d|f}|oti|ƒntid|ƒdS(sƒInsert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. iN(R R+RJRK(R7RR!RJR6((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.pyRMºscCsNxG|D]?}yt|ƒWqtj o}tidI|IJqXqWdS(NsInvalid -W option ignored:(t _setoptionRMRR>(targstargR8((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): %rRFt$isinvalid lineno %r( RGtsplittlenRMRJRCt _getactiontescapet _getcategorytintRt OverflowErrorR( RRRGtpartst_[1]RDR7RRR"R!((s/sys/lib/python/warnings.pyRPÇs. /    cCsd|pdSn|djodSnx&d D]}|i|ƒo|Sq+q+Wtd|fƒ‚dS( NRtallR)R&R"R(R'sinvalid action: %r(sdefaultsalwayssignoresmodulesonceserror(t startswithRM(R7ta((s/sys/lib/python/warnings.pyRXâ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( RGR R,tevalt NameErrorRMtrfindt __import__R t ImportErrortgetattrRR-(RRGR9tiR"tklasstm((s/sys/lib/python/warnings.pyRZìs,  R&RRJ(RORttypesR/t__all__R+R.R1R RRRRR RRLRt ExceptionRMRSRPRXRZt warnoptionstPendingDeprecationWarningt ImportWarning(((s/sys/lib/python/warnings.pyss.   )?