Skip to content

Commit 89faefc

Browse files
simonjayhawkinsproost
authored andcommitted
TYP: some types for pandas/util/_exceptions.py (pandas-dev#29881)
1 parent 66c5483 commit 89faefc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/util/_exceptions.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import contextlib
2+
from typing import Tuple
23

34

45
@contextlib.contextmanager
5-
def rewrite_exception(old_name, new_name):
6+
def rewrite_exception(old_name: str, new_name: str):
67
"""Rewrite the message of an exception."""
78
try:
89
yield
910
except Exception as err:
1011
msg = err.args[0]
1112
msg = msg.replace(old_name, new_name)
12-
args = (msg,)
13+
args: Tuple[str, ...] = (msg,)
1314
if len(err.args) > 1:
1415
args = args + err.args[1:]
1516
err.args = args

0 commit comments

Comments
 (0)