controller: clean up poll loop
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index a65aed2..9c01068 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -608,12 +608,10 @@
# Take the packet from the queue
def grab():
- for i in range(len(self.packets)):
- msg = self.packets[i][0]
+ for i, (msg, pkt) in enumerate(self.packets):
if klass is None or isinstance(msg, klass):
self.logger.debug("Got %s message", msg.__class__.__name__)
- (msg, pkt) = self.packets.pop(i)
- return (msg, pkt)
+ return self.packets.pop(i)
# Not found
self.logger.debug("%s message not in queue", klass.__name__)
return None