Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pymodbus/datastore/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def handle_type_string(self, start, stop, value, action, action_parameters):
def handle_setup_section(self):
"""Load setup section."""
layout = Label.try_get(Label.setup, self.config)
self.runtime.fc_offset = {key: 0 for key in range(25)}
self.runtime.fc_offset = dict.fromkeys(range(25), 0)
size_co = Label.try_get(Label.co_size, layout)
size_di = Label.try_get(Label.di_size, layout)
size_hr = Label.try_get(Label.hr_size, layout)
Expand Down
4 changes: 2 additions & 2 deletions pymodbus/pdu/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class ModbusCountersHandler:
.. note:: I threw the event counter in here for convenience
"""

__data = {i: 0x0000 for i in range(9)}
__data = dict.fromkeys(range(9), 0x00)
__names = [
"BusMessage",
"BusCommunicationError",
Expand Down Expand Up @@ -401,7 +401,7 @@ def update(self, values):

def reset(self):
"""Clear all of the system counters."""
self.__data = {i: 0x0000 for i in range(9)}
self.__data = dict.fromkeys(range(9), 0x00)

def summary(self):
"""Return a summary of the counters current status.
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,8 @@ skip = "./build,./doc/source/_static,venv,.venv,.git,htmlcov,CHANGELOG.rst,.mypy
ignore-words-list = "asend"

[tool.ruff]
target-version="py38"
exclude = [
"venv",
".venv",
".git",
target-version="py39"
extend-exclude = [
"build",
"doc",
"contrib"
Expand Down