mirror of https://github.com/secdev/scapy.git
Use the key argument with sort()
This commit is contained in:
parent
364ea44f75
commit
25f68d0eee
|
@ -182,8 +182,8 @@ def get_working_ifaces():
|
|||
os.close(fd)
|
||||
|
||||
# Sort to mimic pcap_findalldevs() order
|
||||
interfaces.sort(lambda ifname_left_and_ifid_left,
|
||||
ifname_right_and_ifid_right: ifname_left_and_ifid_left[1]-ifname_right_and_ifid_right[1])
|
||||
interfaces.sort(key=lambda elt: elt[1])
|
||||
|
||||
return interfaces
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue