updated network.py to leverage super()
This commit is contained in:
parent
68be311c7a
commit
b185c3c679
2 changed files with 16 additions and 24 deletions
|
@ -139,7 +139,7 @@ class NodeBase:
|
|||
if sort:
|
||||
return [self._netif[x] for x in sorted(self._netif)]
|
||||
else:
|
||||
return self._netif.values()
|
||||
return list(self._netif.values())
|
||||
|
||||
def numnetif(self):
|
||||
"""
|
||||
|
@ -158,11 +158,9 @@ class NodeBase:
|
|||
:return: interface index if found, -1 otherwise
|
||||
:rtype: int
|
||||
"""
|
||||
|
||||
for ifindex in self._netif:
|
||||
if self._netif[ifindex] is netif:
|
||||
return ifindex
|
||||
|
||||
return -1
|
||||
|
||||
def newifindex(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue