Generators in Python 3 don't have .next method. It's recommended
to use 'next' builtin instead. As it also present in Python >= 2.6
it should make wic code compatible with both Python 2 and Python 3.
[YOCTO #9412]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
self._log.debug("FilemapFiemap: get_mapped_ranges(%d, %d(%d))"
% (start, count, start + count - 1))
iterator = self._do_get_mapped_ranges(start, count)
- first_prev, last_prev = iterator.next()
+ first_prev, last_prev = next(iterator)
for first, last in iterator:
if last_prev == first - 1:
return head, msg
def get_loglevel():
- return (k for k, v in LOG_LEVELS.items() if v == LOG_LEVEL).next()
+ return next((k for k, v in LOG_LEVELS.items() if v == LOG_LEVEL))
def set_loglevel(level):
global LOG_LEVEL