Skip to content

Commit e342eb5

Browse files
authored
Don't bool-test explicit datastores (#2638)
1 parent 6d81ee3 commit e342eb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pymodbus/datastore/context.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ def __init__(self, *_args,
9090
):
9191
"""Initialize the datastores."""
9292
self.store = {}
93-
self.store["d"] = di or ModbusSequentialDataBlock.create()
94-
self.store["c"] = co or ModbusSequentialDataBlock.create()
95-
self.store["i"] = ir or ModbusSequentialDataBlock.create()
96-
self.store["h"] = hr or ModbusSequentialDataBlock.create()
93+
self.store["d"] = di if di is not None else ModbusSequentialDataBlock.create()
94+
self.store["c"] = co if di is not None else ModbusSequentialDataBlock.create()
95+
self.store["i"] = ir if di is not None else ModbusSequentialDataBlock.create()
96+
self.store["h"] = hr if di is not None else ModbusSequentialDataBlock.create()
9797

9898
def __str__(self):
9999
"""Return a string representation of the context.

0 commit comments

Comments
 (0)