Skip to content

Commit 1262b1d

Browse files
committed
Fix typing errors introduced by the latest mypy release.
Also, update mypy pre-commit hook to the latest version. Change-Id: If32562fc661cd59ea00231007a1129914d3a1c5e
1 parent 1141d96 commit 1262b1d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
hooks:
3737
- id: isort
3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v0.991
39+
rev: v1.3.0
4040
hooks:
4141
- id: mypy
4242
additional_dependencies: [

lib/mysql/connector/cursor_cext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def execute(
320320
stmt = stmt.replace(f"%({key})s".encode(), value)
321321
elif isinstance(prepared, (list, tuple)):
322322
psub = _ParamSubstitutor(prepared)
323-
stmt = RE_PY_PARAM.sub(psub, stmt)
323+
stmt = RE_PY_PARAM.sub(psub, stmt) # type: ignore[call-overload]
324324
if psub.remaining != 0:
325325
raise ProgrammingError(
326326
"Not all parameters were used in the SQL statement"
@@ -388,7 +388,7 @@ def remove_comments(match: re.Match) -> str:
388388
tmp = tmp.replace(f"%({key})s".encode(), value)
389389
elif isinstance(prepared, (list, tuple)):
390390
psub = _ParamSubstitutor(prepared)
391-
tmp = RE_PY_PARAM.sub(psub, tmp)
391+
tmp = RE_PY_PARAM.sub(psub, tmp) # type: ignore[call-overload]
392392
if psub.remaining != 0:
393393
raise ProgrammingError(
394394
"Not all parameters were used in the SQL statement"

0 commit comments

Comments
 (0)