Do not raise StopIteration when calling pairwise with empty iterable
Closes #12652 (grafted from bf2f33fe3adf63deae1162ab64f0a1c2cc43eee0) --HG-- branch : 6.0
This commit is contained in:
1 parent
2bf177778c
commit
c375b2f1c7
2 files changed
+2
-2
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user