Do not raise StopIteration when calling pairwise with empty iterable
Closes #12652
This commit is contained in:
@@ -23,7 +23,7 @@ from trytond.transaction import Transaction
|
||||
|
||||
def pairwise(iterable):
|
||||
a, b = tee(iterable)
|
||||
next(b)
|
||||
next(b, None)
|
||||
return zip_longest(a, b)
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from trytond.transaction import Transaction
|
||||
|
||||
def pairwise(iterable):
|
||||
a, b = tee(iterable)
|
||||
next(b)
|
||||
next(b, None)
|
||||
return zip_longest(a, b)
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ from trytond.wizard import StateAction, StateTransition, Wizard
|
||||
|
||||
def pairwise(iterable):
|
||||
a, b = tee(iterable)
|
||||
next(b)
|
||||
next(b, None)
|
||||
return zip_longest(a, b)
|
||||
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from trytond.transaction import Transaction
|
||||
|
||||
def pairwise(iterable):
|
||||
a, b = tee(iterable)
|
||||
next(b)
|
||||
next(b, None)
|
||||
return zip_longest(a, b)
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ from trytond.transaction import Transaction
|
||||
|
||||
def pairwise(iterable):
|
||||
a, b = tee(iterable)
|
||||
next(b)
|
||||
next(b, None)
|
||||
return zip_longest(a, b)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user