Do not raise StopIteration when calling pairwise with empty iterable

Closes #12652
(grafted from bf2f33fe3adf63deae1162ab64f0a1c2cc43eee0)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-10-18 18:28:04 +02:00
1 parent 2bf177778c
commit c375b2f1c7
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ from trytond.i18n import lazy_gettext
def pairwise(iterable):
a, b = tee(iterable)
next(b)
next(b, None)
return zip_longest(a, b)
+1 -1
View File
@@ -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)