--- a/modbus/modbus.py Thu Jun 07 16:53:21 2018 +0300
+++ b/modbus/modbus.py Thu Jun 07 16:58:13 2018 +0300
@@ -598,10 +598,11 @@
for j in range(i + 1, len(IPServer_port_numbers)):
if IPServer_port_numbers[i][1] == IPServer_port_numbers[j][1]:
self.GetCTRoot().logger.write_warning(
- _("Error: Modbus/IP Servers %s.x and %s.x use the same port number %s.\n") % (
- _lt_to_str(IPServer_port_numbers[i][0]),
- _lt_to_str(IPServer_port_numbers[j][0]),
- IPServer_port_numbers[j][1]))
+ _("Error: Modbus/IP Servers %{a1}.x and %{a2}.x use the same port number {a3}.\n").\
+ format(
+ a1=_lt_to_str(IPServer_port_numbers[i][0]),
+ a2=_lt_to_str(IPServer_port_numbers[j][0]),
+ a3=IPServer_port_numbers[j][1]))
raise Exception
# TODO: return an error code instead of raising an
# exception