Skip to content

Commit 27b2915

Browse files
authored
enable mypy --check-untyped-defs (#2096)
1 parent 504af27 commit 27b2915

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

pymodbus/diag_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def execute(self, *args):
382382
383383
:returns: The initialized response message
384384
"""
385-
char = (self.message & 0xFF00) >> 8
385+
char = (self.message & 0xFF00) >> 8 # type: ignore[operator]
386386
_MCB._setDelimiter(char) # pylint: disable=protected-access
387387
return ChangeAsciiInputDelimiterResponse(self.message)
388388

pymodbus/transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def execute(self, request): # noqa: C901
241241
"/Unable to decode response"
242242
)
243243
response = ModbusIOException(
244-
last_exception, request.function_code
244+
last_exception, request.function_code # type: ignore[assignment]
245245
)
246246
self.client.close()
247247
if hasattr(self.client, "state"):

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ strict_concatenate = false
198198
disallow_subclassing_any = true
199199
disallow_untyped_decorators = true
200200
warn_unreachable = true
201+
check_untyped_defs = true
201202

202203
[tool.distutils]
203204
bdist_wheel = {}

0 commit comments

Comments
 (0)