grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a ´ièLã@sÌdZddlZgd¢Zd=dd„Zd>dd„Zdd „Zd d „ZeZd d „ZeZ dd„Z de dddfdd„Z e ddfdd„Z dd„Zdd„ZGdd„deƒZdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd?d)d*„Zd@d+d,„ZGd-d.„d.eƒZGd/d0„d0eƒZd1d2„Zz0dd3lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d4Z%Wn0e&�y`gZd5Z#iZ$d(a'd6d7„Z"dZ%Yn0eej(ƒe%�sÆe)ed8ƒ�sÆe d5e*d9d(d:�e d;e*d(d<�e d;e+d(d<�e d;e,d(d<�e d;e-d(d<�[%dS)Az&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.9/warnings.pyr srcCst||||d|ƒ}t|ƒS)ú.Function to format a warning the standard way.N)r Ú_formatwarnmsg_impl)r rrrrrrrrrsrcCsN|j}|dur tj}|dur dSt|ƒ}z| |¡WntyHYn0dS©N)rÚsysÚstderrÚ_formatwarnmsgÚwriteÚOSError)rrÚtextrrrr s r c Cs”|jj}|j›d|j›d|›d|j›d�}|jdurnzddl}| |j|j¡}Wqttyjd}d}Yqt0n|j}|rŒ|  ¡}|d|7}|j du�r�z ddl }Wnty¾d}d}Yn20|  ¡}z|  |j ¡}Wntyîd}Yn0|du�r||d7}|D]r}|d|j|jf7}z$|du�r<| |j|j¡}nd}Wnt�yZd}Yn0|�r|  ¡}|d |7}�qn|�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"            ÿ  rcCsbzt}WntyYn<0|turVt|ƒs4tdƒ‚||j|j|j|j|j |j ƒdSt |ƒdS)r z:warnings.showwarning() must be set to a function or methodN) rÚ NameErrorÚ_showwarning_origÚcallableÚ TypeErrorr rrrrrr )rÚswrrrÚ _showwarnmsg`s ÿr3cCsFzt}WntyYn$0|tur>||j|j|j|j|jƒSt|ƒS)r) rr.Ú_formatwarning_origr rrrrr)rÚfwrrrrus   ÿrÚFcCsÌ|dvsJd|fƒ‚t|tƒs(Jdƒ‚t|tƒs:Jdƒ‚t|tƒsLJdƒ‚t|tƒs^Jdƒ‚t|tƒrp|dksxJdƒ‚|s€|rˆdd l}|rœ| ||j¡}nd }|r°| |¡}nd }t ||||||d �d S) aÖInsert an entry into the list of warnings filters (at the front). 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'message' -- a regex that the warning message must match 'category' -- a class that the warning must be a subclass of 'module' -- a regex that the module name must match 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters ©ÚerrorÚignoreÚalwaysÚdefaultÚmoduleÚonceúinvalid action: %rzmessage must be a stringzcategory must be a classz#category must be a Warning subclasszmodule must be a stringrúlineno must be an int >= 0N©Úappend) Ú isinstanceÚstrÚtypeÚ issubclassÚWarningÚintÚreÚcompileÚIÚ _add_filter)Úactionr rr<rrArHrrrr‚s& ÿÿ rcCsH|dvsJd|fƒ‚t|tƒr(|dks0Jdƒ‚t|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'category' -- a class that the warning must be a subclass of 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters r7r>rr?Nr@)rBrGrK)rLrrrArrrr¥s ÿÿrcGsP|s4zt |¡Wnty$Yn0t d|¡n|tvrFt |¡tƒdS)Nr)ÚfiltersÚremoveÚ ValueErrorÚinsertrAÚ_filters_mutated)rAÚitemrrrrKµs  rKcCsgtdd…<tƒdS)zAClear the list of warning filters, so that no filters are active.N)rMrQrrrrrÃs rc@seZdZdZdS)Ú _OptionErrorz,Exception used by option processing helpers.N)r!Ú __module__Ú __qualname__Ú__doc__rrrrrSÈsrSc CsP|D]F}z t|ƒWqtyH}ztd|tjd�WYd}~qd}~00qdS)NzInvalid -W option ignored:)r)Ú _setoptionrSÚprintrr)ÚargsÚargrrrrÚ_processoptionsÍs  r[c Csò| d¡}t|ƒdkr$td|fƒ‚t|ƒdkr<| d¡q$dd„|Dƒ\}}}}}t|ƒ}t|ƒ}|sl|rtddl}|r‚| |¡}|r”| |¡d}|rÚzt|ƒ}|dkr®t ‚WqÞt t fyÖtd |fƒd‚YqÞ0nd}t |||||ƒdS) Nréztoo many fields (max 5): %rr6cSsg|] }| ¡‘qSr)r%)Ú.0r*rrrÚ Ûsÿz_setoption..rz\Zzinvalid lineno %r) ÚsplitÚlenrSrAÚ _getactionÚ _getcategoryrHÚescaperGrOÚ OverflowErrorr)rZÚpartsrLr rr<rrHrrrrWÕs2    ÿ rWcCsB|sdS|dkrdSdD]}| |¡r|Sqtd|fƒ‚dS)Nr;Úallr:)r;r:r9r<r=r8r>)Ú startswithrS)rLÚarrrrañs   racCs´|stSd|vrddl}|}nH| d¡\}}}zt|dd|gƒ}Wn"tydtd|fƒd‚Yn0zt||ƒ}Wn"ty–td|fƒd‚Yn0t|tƒs°td|fƒ‚|S)NÚ.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r) rFÚbuiltinsÚ rpartitionÚ __import__Ú ImportErrorrSÚgetattrÚAttributeErrorrE)rÚmÚklassr<Ú_Úcatrrrrbûs"   rbcCs|jj}d|vod|vS)zFSignal whether the frame is an internal CPython implementation detail.Ú importlibÚ _bootstrap)Úf_codeÚ co_filename)r-rrrrÚ_is_internal_framesrxcCs"|j}|durt|ƒr|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)Úf_backrx)r-rrrÚ_next_external_framesrzéc Cs t|tƒr|j}|durt}t|tƒr0t|tƒsDtd t|ƒj¡ƒ‚zV|dks\t t   d¡ƒrht   |¡}n0t   d¡}t |dƒD]}t |ƒ}|dur~t‚q~Wn tyºt j}d}d}Yn0|j}|jj}|j}d|vrâ|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}'r{rr!zZ__warningregistry__)rBrFÚ __class__Ú UserWarningrDrEr1Úformatr!rxrÚ _getframeÚrangerzrOÚ__dict__Ú f_globalsrvrwÚf_linenoÚ setdefaultr) r rÚ stacklevelr&r-ÚxÚglobalsrrr<Úregistryrrrrs< ÿ       ÿrcCsèt|ƒ}|dur8|pd}|dd… ¡dkr8|dd…}|durDi}| dd¡tkrd| ¡t|d<t|tƒr~t|ƒ}|j}n |}||ƒ}|||f} | | ¡r¢dSt D]V} | \} } } }}| dusÊ|   |¡r¦t || ƒr¦|dusæ|  |¡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Úversionrr9r8r=r{r:r<r;z1Unrecognized action (%r) in warnings.filters: %s)rGÚlowerÚgetÚ_filters_versionÚclearrBrFrCr|rMÚmatchrEÚ defaultactionr"ÚgetlinesÚ onceregistryÚ RuntimeErrorr r3)r rrrr<rˆÚmodule_globalsr&rÚkeyrRrLrrsÚmodZlnr"ZoncekeyZaltkeyrrrrGs|    ÿþþýý             ÿÿrc@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!rTrUÚ_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(||_|durtjdn||_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¡|jtjdur4| d|j¡t|ƒj}d|d |¡fS)Nz record=Truer�z module=%rz%s(%s)z, )ržrAr rrŸrDr!Újoin)r˜rYÚ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 rMÚ_filtersrQrÚ _showwarningr ržrAr/)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 rMrQr¦rr )r˜Úexc_inforrrÚ__exit__Ýs     zcatch_warnings.__exit__)r!rTrUrVr™r¤r¨rªrrrrr ¤s   r cszdˆj›d�g}ˆjdurVddl‰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&) rUr¬r"Ú tracebackrAÚ format_listÚlistr¢ÚrstriprÚRuntimeWarning)r¯Ú msg_linesr²r°rrr®rÚ_warn_unawaited_coroutineçs ÿ  r¸)rMÚ_defaultactionÚ _onceregistryrrrQTr;cCs td7adS)Nr{)r�rrrrrQsrQZgettotalrefcountÚ__main__)rr<rAr9)rrA)NN)N)Nr{N)NNNN).rVrÚ__all__rrr rr/r3r4rrFrrrKrr$rSr[rWrarbrxrzrrÚobjectr r r¸Ú _warningsrMr¹rºrQr�r’Z_warnings_defaultsrmr�Ú warnoptionsÚhasattrÚDeprecationWarningÚPendingDeprecationWarningÚ ImportWarningÚResourceWarningrrrrÚsj  ; ÿ #  )þ GC    ÿ