'Vfi< ddlmZddlZddlZddlZddlZddlmZddlZer ddl m Z ddl m Z ej dd Zdd Zej dddZdS)) annotationsN) TYPE_CHECKING) Generator) FrameTypeold_namestrnew_namereturnGenerator[None, None, None]c#K dVdS#t$rr}|jst|jd}|||}|f}t |jdkr||jddz}||_d}~wwxYw)z. Rewrite the message of an exception. Nr) Exceptionargsrreplacelen)rr errmsgrs Fc:\PYTHON\DbComparer\venv\Lib\site-packages\pandas/util/_exceptions.pyrewrite_exceptionrs      x  #(1+kk(H--!$ sx==1  #(122,&D  s BA-BBintcrddl}tj|j}tj|d}t j} d}|rNt j|}| |r"| |s |j }|dz }nn|N~n#~wxYw|S)zb Find the first place in the stack that is not inside pandas (tests notwithstanding). rNtestsr ) pandasospathdirname__file__joininspect currentframegetfile startswithf_back)pdpkg_dirtest_dirframenfilenames rfind_stack_levelr*"s goobk**Gw||GW--H&244E   u--H""7++ H4G4G4Q4Q  Q   EE Hs AB11B4target_messagetarget_category type[Warning] new_message new_categorytype[Warning] | Nonec#K||}tjd5}dVdddn #1swxYwYt|dkr~tj|}|D]i}|j|ur,tj|t|jr|}|}n|j|j}}tj |||j |j hdSdS)a Rewrite the message of a warning. Parameters ---------- target_message : str Warning message to match. target_category : Warning Warning type to match. new_message : str New warning message to emit. new_category : Warning or None, default None New warning type to emit. When None, will be the same as target_category. NT)recordr)messagecategoryr)lineno) warningscatch_warningsrrecompiler4searchrr3 warn_explicitr)r5) r+r,r.r/r2matchwarningr4r3s rrewrite_warningr>?s:*&   - - -  6{{Q >**  G?22rys7?++882()4$+$4go'  "! )~        s -11)rrr rr r )r r)N) r+rr,r-r.rr/r0r r ) __future__r contextlibrrr8typingrr6collections.abcrtypesrcontextmanagerrr*r>rrGs""""""  )))))) $    :  *. '''''''rF