B (nzx@sddlZdddddddd gZd;d dZdd+dZGd,d-d-eZGd.d d eZd/d0Zy0dd1lmZmZm Z mZmZm!Z!eZ"e Z#d2Z$Wn2e%k rjgZd3Z"iZ#d)a&d4d5Z!dZ$YnXeej'e$se(ed6se d3e)d7d)d8e d9e)d)d:e d9e*d)d:e d9e+d)d:e d9e,d)d:[$dS)?Nwarn warn_explicit showwarning formatwarningfilterwarnings simplefilter resetwarningscatch_warningscCst||||||}t|dS)N)WarningMessage_showwarnmsg_impl)messagecategoryfilenamelinenofilelinemsgr+/opt/alt/python37/lib/python3.7/warnings.pyr scCst||||d|}t|S)N)r _formatwarnmsg_impl)r r rrrrrrrrscCsP|j}|dkr tj}|dkr dSt|}y||Wntk rJYnXdS)N)rsysstderr_formatwarnmsgwriteOSError)rrtextrrrr sr c Cs|jj}|jd|jd|d|jd}|jdkrpyddl}||j|j}Wqvtk rld}d}YqvXn|j}|r| }|d|7}|j dk ry ddl }Wntk rd}d}Yn4X| }y| |j }Wntk rd}YnX|dk r|d7}x|D]t}|d|j|jf7}y$|dk rD||j|j}nd}Wntk rdd}YnX|r| }|d |7}qWn|s||d 7}|S) N:z:  rz %s Tz-Object allocated at (most recent call last): z File "%s", lineno %s z %s z<: Enable tracemalloc to get the object allocation traceback )r __name__rrr r linecachegetline Exceptionstripsource tracemalloc is_tracingget_object_traceback) rr srrr$tracingtbframerrrr#sR"           rcCsdyt}Wntk rYn|dq&Wdd|D\}}}}}t|}t|}|sp|rxddl}|r||}|r||d}|ryt|}|dkrt Wqt t fk rtd |fdYqXnd}t |||||dS) Nrztoo many fields (max 5): %rr3cSsg|] }|qSr)r").0r'rrr sz_setoption..rz\Zzinvalid lineno %r) splitlenrAr4 _getaction _getcategoryr5escapeintr= OverflowErrorr)rGpartsr9r r r:rr5rrrrDs0   rDcCsB|sdS|dkrdSxdD]}||r|SqWtd|fdS)Ndefaultallalways)rTrVignorer:onceerrorzinvalid action: %r) startswithrA)r9arrrrNs  rNcCs|stSd|krddl}|}nJ|d\}}}yt|dd|g}Wn$tk rftd|fdYnXyt||}Wn$tk rtd|fdYnXt|tstd|f|S)N.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r) Warningbuiltins rpartition __import__ ImportErrorrAgetattrAttributeError issubclass)r mklassr:_catrrrrOs" rOcCs|jj}d|kod|kS)N importlib _bootstrap)f_code co_filename)r*rrrr_is_internal_framesrmcCs&|j}x|dk r t|r |j}qW|S)N)f_backrm)r*rrr_next_external_frames roc Csvt|tr|j}|dkrt}t|tr0t|tsDtdt|jyZ|dks\t t drht |}n4t d}x(t |dD]}t |}|dkrtqWWntk rt j}d}YnX|j}|j}d|kr|d}nd}|d} | r| } | drP| dd} n>|dkrFyt jd } Wntk rDd} YnX| sP|} |d i} t||| ||| ||dS) Nz/category must be a Warning subclass, not '{:s}'rprz__file__z.pyc__main__rZ__warningregistry__) isinstancer] __class__ UserWarningtyperdr.formatrrmr _getframerangeror=__dict__ f_globalsf_linenogetlowerendswithargvrc setdefaultr) r r stacklevelr#r*xglobalsrr:rZfnlregistryrrrrsL           cCst|}|dkr8|pd}|dddkr8|dd}|dkrDi}|ddtkrd|t|d<t|tr~t|}|j}n |}||}|||f} || rdSx^t D]R} | \} } } }}| dks| |rt || r|dks| |r|dks||krPqWt } | dkrdSddl }|||| dkr2|| dkrfd || <||f}t|r\dSd t|<nf| d krrnZ| d krd || <||df}||rdSd ||<n$| d krd || <ntd | | ft|||||} t| dS)Nz z.pyversionrrWrYrXrprVr:rTz1Unrecognized action (%r) in warnings.filters: %s)rQrr~_filters_versionclearrtr]strrur;matchrd defaultactionrgetlines onceregistry RuntimeErrorr r0)r r rrr:rmodule_globalsr#rkeyr@r9rrhmodZlnrZoncekeyZaltkeyrrrrSsj                    c@s"eZdZdZdddZddZdS)r )r r rrrrr#NcCs>||_||_||_||_||_||_||_|r4|jnd|_dS)N) r r rrrrr#r_category_name)selfr r rrrrr#rrr__init__szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r rrrr)rrrr__str__szWarningMessage.__str__)NNN)rrBrC_WARNING_DETAILSrrrrrrr s r c@s4eZdZdddddZddZdd Zd d ZdS) r FN)recordr:cCs(||_|dkrtjdn||_d|_dS)NwarningsF)_recordrmodules_module_entered)rrr:rrrrszcatch_warnings.__init__cCsPg}|jr|d|jtjdk r4|d|jt|j}d|d|fS)Nz record=Truerz module=%rz%s(%s)z, )rr4rrrrwrjoin)rrFnamerrr__repr__s  zcatch_warnings.__repr__cCs~|jrtd|d|_|jj|_|jdd|j_|j|jj|_|jj|_|j rvg}|j |j_|jj |j_|SdSdS)NzCannot enter %r twiceT) rrrr;_filtersr?r _showwarningr rr4r,)rlogrrr __enter__s       zcatch_warnings.__enter__cGs>|jstd||j|j_|j|j|j_|j|j_dS)Nz%Cannot exit %r without entering first) rrrrr;r?rrr )rexc_inforrr__exit__s     zcatch_warnings.__exit__)rrBrCrrrrrrrrr s  cszdjdg}jdk rVddlddl}fdd}|d||t|7}d|d}t |t d d dS) Nz coroutine 'z' was never awaited rc3s8x2tjD]$\}}}||}||||fVq WdS)N)reversed cr_originr )rrfuncnamer)cororrrextracts z*_warn_unawaited_coroutine..extractz-Coroutine created at (most recent call last) r3r)r rr#) rCrr tracebackr4 format_listlistrrstriprRuntimeWarning)r msg_linesrrrr)rrr_warn_unawaited_coroutines  r)r;_defaultaction _onceregistryrrr?TrTcCs td7adS)Nrp)rrrrrr?sr?Zgettotalrefcountrs)r r:r4rW)r r4)NN)N)NrpN)NNNN)-r__all__rrr rr,r0r1rr]rrr8rr!rArHrDrNrOrmrorrobjectr r r _warningsr;rrr?rrZ_warnings_defaultsrar warnoptionshasattrDeprecationWarningPendingDeprecationWarning ImportWarningResourceWarningrrrrsf  ;  "  5 EC