Skip to content

Commit bd7e0f9

Browse files
committed
enable mypy --check-untyped-defs
1 parent a61db90 commit bd7e0f9

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
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/framer/ascii_framer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def buildPacket(self, message):
113113
packet.extend(b2a_hex(encoded))
114114
packet.extend(f"{checksum:02x}".encode())
115115
packet.extend(self._end)
116-
packet = bytes(packet).upper()
116+
packet = bytes(packet).upper() # type: ignore[assignment]
117117

118118
data = message.function_code.to_bytes(1,'big') + encoded
119119
packet_new = self.message_handler.encode(data, message.slave_id, message.transaction_id)

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)