Sindbad~EG File Manager
�
Mٜg< � �� � d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlZerd dl m
Z
d dlmZ ej d d�� Zd
d�Zej d dd�� Zy)
� )�annotationsN)�
TYPE_CHECKING)� Generator)� FrameTypec # � K � d�� y# t $ rq}|j s� t |j d � }|j | |� }|f}t |j � dkD r||j dd z }||_ � d}~ww xY w�w)z.
Rewrite the message of an exception.
Nr � )� Exception�args�str�replace�len)�old_name�new_name�err�msgr
s �B/usr/local/lib/python3.12/site-packages/pandas/util/_exceptions.py�rewrite_exceptionr s~ � �� �
�
��� ��x�x���#�(�(�1�+����k�k�(�H�-��!$����s�x�x�=�1���#�(�(�1�2�,�&�D����
�� �s% �B� �B� B�A,A>�>B�Bc � � ddl } t j j | j � }t j j |d� }t
j � } d}|rPt
j |� }|j |� r#|j |� s|j }|dz
}n ~|S |r�P~|S # ~w xY w)zb
Find the first place in the stack that is not inside pandas
(tests notwithstanding).
r N�testsr )�pandas�os�path�dirname�__file__�join�inspect�currentframe�getfile�
startswith�f_back)�pd�pkg_dir�test_dir�frame�n�filenames r �find_stack_levelr'