mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-26 19:11:38 +01:00
ovs/vsctl: Avoid applying next() to non-iterator object
In Python 2, the builtin function next() can not be applied to non-iterator object. This patch fixes to use the list comprehensions and avoid applying next() to a list type object. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
895ddfca26
commit
513bf4c48c
@ -126,8 +126,8 @@ def datum_from_string(type_, value_string, symtab=None):
|
||||
|
||||
def ifind(pred, seq):
|
||||
try:
|
||||
return next(filter(pred, seq))
|
||||
except StopIteration:
|
||||
return [i for i in seq if pred(i)][0]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user