diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 10b8a5b202872..5e5318a746b94 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -1662,7 +1662,7 @@ def __init__( f"only the xls format is supported. Install openpyxl instead." ) elif ext and ext != "xls": - stacklevel = find_stack_level() + stacklevel = find_stack_level(inspect.currentframe()) warnings.warn( f"Your version of xlrd is {xlrd_version}. In xlrd >= 2.0, " f"only the xls format is supported. Install "