1.1 --- a/vRecurrence.py Sat Dec 02 23:46:33 2017 +0100
1.2 +++ b/vRecurrence.py Sun Dec 03 00:23:51 2017 +0100
1.3 @@ -1430,11 +1430,25 @@
1.4 "Return the next value, initially the start period."
1.5
1.6 while not self.at_limit():
1.7 - result = self.next_item(self.start, self.end)
1.8 +
1.9 + # Obtain the next item.
1.10 +
1.11 + try:
1.12 + result = self.next_item(self.start, self.end)
1.13 + except StopIteration:
1.14 +
1.15 + # With no more values, flush any waiting value.
1.16 +
1.17 + if self.waiting is not None:
1.18 + result = self.waiting
1.19 + self.waiting = None
1.20 + return result
1.21 + else:
1.22 + raise
1.23
1.24 # Compare with any waiting value.
1.25
1.26 - if self.waiting:
1.27 + if self.waiting is not None:
1.28
1.29 # Produce the waiting value, queue the latest result.
1.30