Do not raise StopIteration when calling pairwise with empty iterable

Closes #12652
This commit is contained in:
Cédric Krier
2023-10-18 18:28:04 +02:00
parent 0f145266e9
commit 7e2c1f8cbd
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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)