Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 29216:ead25aa27a43
py3: convert to next() function
next(..) was introduced in py2.6 and .next() is not available in py3
https://docs.python.org/2/library/functions.html#next
author | timeless <timeless@mozdev.org> |
---|---|
date | Mon, 16 May 2016 21:30:53 +0000 |
parents | f5983805574e |
children | e150c1d5f262 |
comparison
equal
deleted
inserted
replaced
29215:f5983805574e | 29216:ead25aa27a43 |
---|---|
2819 val2 = None | 2819 val2 = None |
2820 try: | 2820 try: |
2821 # Consume both iterators in an ordered way until one is empty | 2821 # Consume both iterators in an ordered way until one is empty |
2822 while True: | 2822 while True: |
2823 if val1 is None: | 2823 if val1 is None: |
2824 val1 = iter1.next() | 2824 val1 = next(iter1) |
2825 if val2 is None: | 2825 if val2 is None: |
2826 val2 = iter2.next() | 2826 val2 = next(iter2) |
2827 n = choice(val1, val2) | 2827 n = choice(val1, val2) |
2828 yield n | 2828 yield n |
2829 if val1 == n: | 2829 if val1 == n: |
2830 val1 = None | 2830 val1 = None |
2831 if val2 == n: | 2831 if val2 == n: |