We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d26b18c commit eba821aCopy full SHA for eba821a
pandas/util/_exceptions.py
@@ -1,15 +1,16 @@
1
import contextlib
2
+from typing import Tuple
3
4
5
@contextlib.contextmanager
-def rewrite_exception(old_name, new_name):
6
+def rewrite_exception(old_name: str, new_name: str):
7
"""Rewrite the message of an exception."""
8
try:
9
yield
10
except Exception as err:
11
msg = err.args[0]
12
msg = msg.replace(old_name, new_name)
- args = (msg,)
13
+ args: Tuple[str, ...] = (msg,)
14
if len(err.args) > 1:
15
args = args + err.args[1:]
16
err.args = args
0 commit comments