1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

fix syntax and remove string format function call (#243)

This commit is contained in:
Joel Bender 2019-02-15 18:35:42 -05:00
parent fd27c54ac7
commit 9af0e54c7c
2 changed files with 4 additions and 2 deletions

View File

@ -157,7 +157,7 @@ class SSM(OneShotTask, DebugContents):
# check for invalid segment number
if indx >= self.segmentCount:
raise RuntimeError("invalid segment number {0}, APDU has {1} segments".format(indx, self.segmentCount))
raise RuntimeError("invalid segment number %r, APDU has %r segments" % (indx, self.segmentCount))
if self.segmentAPDU.apduType == ConfirmedRequestPDU.pduType:
if _debug: SSM._debug(" - confirmed request context")

View File

@ -419,7 +419,9 @@ class Switch(Client, Server):
Server.__init__(self)
# wrap the terminals
self.terminals = {k:Switch.TerminalWrapper(self, v) for k, v in terminals.items()}
self.terminals = {}
for k, v in terminals.items():
self.terminals[k] = Switch.TerminalWrapper(self, v)
self.current_terminal = None
def __getitem__(self, key):