mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
python: Stop use of tuple parameter unpacking
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> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user