U e5dèLã@sÚdZddlZddddddd d gZdd+d„Zd?d,d„ZGd-d.„d.eƒZGd/d „d eƒZd0d1„Zz0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k �rngZd4Z#iZ$d*a'd5d6„Z"dZ%YnXeej(ƒe%�sÔe)ed7ƒ�sÔe d4e*d8d*d9�e d:e*d*d;�e d:e+d*d;�e d:e,d*d;�e d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.éNÚwarnÚ warn_explicitÚ showwarningÚ formatwarningÚfilterwarningsÚ simplefilterÚ resetwarningsÚcatch_warningscCst||||||ƒ}t|ƒdS)ú7Hook to write a warning to a file; replace if you like.N)ÚWarningMessageÚ_showwarnmsg_impl)ÚmessageÚcategoryÚfilenameÚlinenoÚfileÚlineÚmsg©rú /usr/lib64/python3.8/warnings.pyr scCst||||d|ƒ}t|ƒS)ú.Function to format a warning the standard way.N)r Ú_formatwarnmsg_impl)r rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|ƒ}z| |¡Wntk rJYnXdS©N)rÚsysÚstderrÚ_formatwarnmsgÚwriteÚOSError)rrÚtextrrrr sr c Csœ|jj}|j›d|j›d|›d|j›d�}|jdkrpzddl}| |j|j¡}Wqvtk rld}d}YqvXn|j}|rŽ|  ¡}|d|7}|j dk �r˜z ddl }Wntk rÂd}d}Yn4X|  ¡}z|  |j ¡}Wntk rôd}YnX|dk �r„|d7}|D]t}|d|j|jf7}z$|dk �rB| |j|j¡}nd}Wntk �rbd}YnX|�r |  ¡}|d |7}�q n|�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Ú linecacheÚgetlineÚ ExceptionÚstripÚsourceÚ tracemallocÚ is_tracingÚget_object_traceback) rrÚsr"rr'ÚtracingÚtbÚframerrrr#sT"         ÿ  rcCsdzt}Wntk rYnÛsÿz_setoption..rz\Zzinvalid lineno %r) ÚsplitÚlenrEr8Ú _getactionÚ _getcategoryr9ÚescapeÚintrAÚ OverflowErrorr)rLÚpartsr=r rr>rr9rrrrIÕs2    ÿ rIcCsB|sdS|dkrdSdD]}| |¡r|Sqtd|fƒ‚dS)NÚdefaultÚallÚalways)rYr[Úignorer>ÚonceÚerrorzinvalid action: %r)Ú startswithrE)r=ÚarrrrSñs  rScCs¸|stSd|krddl}|}nJ| d¡\}}}zt|dd|gƒ}Wn$tk rftd|fƒd‚YnXzt||ƒ}Wn$tk rštd|fƒd‚YnXt|tƒs´td|fƒ‚|S)NÚ.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r) ÚWarningÚbuiltinsÚ rpartitionÚ __import__Ú ImportErrorrEÚgetattrÚAttributeErrorÚ issubclass)rÚmÚklassr>Ú_ÚcatrrrrTûs" rTcCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.Ú importlibÚ _bootstrap)Úf_codeÚ co_filename)r-rrrrÚ_is_internal_framesrrcCs"|j}|dk rt|ƒr|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)Úf_backrr)r-rrrÚ_next_external_framesrtéc Cst|tƒr|j}|dkrt}t|tƒr0t|tƒsDtd t|ƒj¡ƒ‚zV|dks\t t   d¡ƒrht   |¡}n0t   d¡}t |dƒD]}t |ƒ}|dkr~t‚q~Wn"tk r¼t j}d}d}YnX|j}|jj}|j}d|krä|d} nd} | di¡} t||||| | ||ƒdS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'rurr!zZ__warningregistry__)Ú isinstancerbÚ __class__Ú UserWarningÚtyperir1Úformatr!rrrÚ _getframeÚrangertrAÚ__dict__Ú f_globalsrprqÚf_linenoÚ setdefaultr) r rÚ stacklevelr&r-ÚxÚglobalsrrr>Úregistryrrrrs> ÿ      ÿcCsèt|ƒ}|dkr8|pd}|dd… ¡dkr8|dd…}|dkrDi}| dd¡tkrd| ¡t|d<t|tƒr~t|ƒ}|j}n |}||ƒ}|||f} | | ¡r¢dSt D]V} | \} } } }}| dksÊ|   |¡r¦t || ƒr¦|dksæ|  |¡r¦|dksö||kr¦�qq¦t } | dk�rdSddl }| ||¡| dk�r2|‚| dk�rfd || <||f}t |¡�r\dSd t|<nf| d k�rrnZ| d k�r¨d || <||df}| |¡�rždSd ||<n$| d k�r¼d || <ntd | | fƒ‚t|||||ƒ} t| ƒdS)Nz éýÿÿÿz.pyÚversionrr\r^r]rur[r>rYz1Unrecognized action (%r) in warnings.filters: %s)rVÚlowerÚgetÚ_filters_versionÚclearrvrbÚstrrwr?ÚmatchriÚ defaultactionr"ÚgetlinesÚ onceregistryÚ RuntimeErrorr r3)r rrrr>r„Úmodule_globalsr&rÚkeyrDr=rrmÚmodZlnr"ZoncekeyZaltkeyrrrrGs|    ÿþþýý             ÿÿc@s"eZdZdZddd„Zdd„ZdS)r )r rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr) r rrrrrr&r!Ú_category_name)Úselfr rrrrrr&rrrÚ__init__“szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r r”rrr)r•rrrÚ__str__žsÿÿzWarningMessage.__str__)NNN)r!rFrGÚ_WARNING_DETAILSr–r—rrrrr Žs ÿ r c@s8eZdZdZdddœdd„Zdd„Zd d „Zd d „ZdS) r a�A context manager that copies and restores the warnings filter upon exiting the context. The 'record' argument specifies whether warnings should be captured by a custom implementation of warnings.showwarning() and be appended to a list returned by the context manager. Otherwise None is returned by the context manager. The objects appended to the list are arguments whose attributes mirror the arguments to showwarning(). The 'module' argument is to specify an alternative module to the module named 'warnings' and imported under that name. This argument is only useful when testing the warnings module itself. FN)Úrecordr>cCs(||_|dkrtjdn||_d|_dS)zêSpecify whether to record warnings and if an alternative module should be used other than sys.modules['warnings']. For compatibility with Python 3.0, please consider all arguments to be keyword-only. NÚwarningsF)Ú_recordrÚmodulesÚ_moduleÚ_entered)r•r™r>rrrr–µszcatch_warnings.__init__cCsPg}|jr| d¡|jtjdk r4| d|j¡t|ƒj}d|d |¡fS)Nz record=Trueršz module=%rz%s(%s)z, )r›r8r�rrœryr!Újoin)r•rKÚnamerrrÚ__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) ržr�r�r?Ú_filtersrCrÚ _showwarningr r›r8r/)r•ÚlogrrrÚ __enter__Ês       zcatch_warnings.__enter__cGs>|jstd|ƒ‚|j|j_|j ¡|j|j_|j|j_dS)Nz%Cannot exit %r without entering first) ržr�r¢r�r?rCr£rr )r•Úexc_inforrrÚ__exit__Ýs     zcatch_warnings.__exit__)r!rFrGrHr–r¡r¥r§rrrrr ¤s   cszdˆj›d�g}ˆjdk rVddl‰ddl}‡‡fdd„}| d¡|| t|ƒƒ¡7}d |¡ d¡}t |t d ˆd �dS) Nz coroutine 'z' was never awaited rc3s4tˆjƒD]$\}}}ˆ ||¡}||||fVq dSr)ÚreversedÚ cr_originr#)rrÚfuncnamer©Úcoror"rrÚextractís z*_warn_unawaited_coroutine..extractz-Coroutine created at (most recent call last) r6r é)rr�r&) rGr©r"Ú tracebackr8Ú format_listÚlistrŸÚrstriprÚRuntimeWarning)r¬Ú msg_linesr¯r­rrr«rÚ_warn_unawaited_coroutineçs ÿ  rµ)r?Ú_defaultactionÚ _onceregistryrrrCTrYcCs td7adS)Nru)r‰rrrrrCsrCZgettotalrefcountÚ__main__)rr>r8r\)rr8)NN)N)NruN)NNNN).rHrÚ__all__rrr rr/r3r4rrbrrr<rr$rErMrIrSrTrrrtrrÚobjectr r rµÚ _warningsr?r¶r·rCr�r�Z_warnings_defaultsrfr‰Ú warnoptionsÚhasattrÚDeprecationWarningÚPendingDeprecationWarningÚ ImportWarningÚResourceWarningrrrrÚs|þ  ; ÿ #  )þ GC    ÿ