@@ -31,7 +31,7 @@ class UdpListener(DatagramProtocol):
def __init__(self):
self.stats = []
- def datagramReceived(self, data, (_1, _2)):
+ def datagramReceived(self, data, _1_2):
"""This function is called each time datagram is received"""
try:
self.stats.append(struct.unpack_from("Q", data, 0))
@@ -67,7 +67,7 @@ class UdpSender(DatagramProtocol):
self.looper.stop()
self.looper = None
- def datagramReceived(self, data, (host, port)):
+ def datagramReceived(self, data, host_port):
pass
def sendData(self):
Python 3 removed support for tuple parameter unpacking. https://www.python.org/dev/peps/pep-3113/ Instead of: def foo((a, b)): print(a) print(b) you should do: def foo(a_b): a, b = a_b print(a) print(b) but in both uses here, the values were never used so the fix is even simpler. Signed-off-by: Russell Bryant <russell@ovn.org> --- python/ovstest/udp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)