Skip to content

Commit 0681493

Browse files
committed
Fixing minor mypy issues in erros.py and cursor_cext.py as
a result of applying patch BUG#24364556: Improve warning behavior Change-Id: I5fba216c416a82723b3898c4c2653d68074627a0
1 parent b6901ac commit 0681493

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/mysql/connector/cursor_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _handle_warnings(self) -> None:
218218
if self._cnx.raise_on_warnings:
219219
raise err
220220

221-
warnings.warn(err, stacklevel=4)
221+
warnings.warn(str(err), stacklevel=4)
222222

223223
def _handle_result(self, result: Union[CextEofPacketType, CextResultType]) -> None:
224224
"""Handles the result after statement execution"""

lib/mysql/connector/errors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __str__(self) -> str:
7575
return self._full_msg
7676

7777

78-
class Warning(Warning, Exception): # pylint: disable=redefined-builtin
78+
class Warning(Exception): # pylint: disable=redefined-builtin
7979
"""Exception for important warnings"""
8080

8181

@@ -138,6 +138,7 @@ class PoolError(Error):
138138
DataError,
139139
NotSupportedError,
140140
PoolError,
141+
Warning,
141142
]
142143
# _CUSTOM_ERROR_EXCEPTIONS holds custom exceptions and is used by the
143144
# function custom_error_exception. _ERROR_EXCEPTIONS (at bottom of module)

0 commit comments

Comments
 (0)