summaryrefslogtreecommitdiff
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-04 16:06:27 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-14 07:26:43 +0100
commit9b7ab632e47d786dd979262015dbfb1254103f83 (patch)
treef47fa12134301e7da8727dd08fd3a8e6ac276fb0 /scripts/lib/wic
parenta56924b4a0102e401b5e37d857a08bab15da974e (diff)
downloadopenembedded-core-9b7ab632e47d786dd979262015dbfb1254103f83.tar.gz
openembedded-core-9b7ab632e47d786dd979262015dbfb1254103f83.tar.bz2
openembedded-core-9b7ab632e47d786dd979262015dbfb1254103f83.zip
wic: use next builtin instead of .next method
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>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r--scripts/lib/wic/filemap.py2
-rw-r--r--scripts/lib/wic/msger.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index 2778be5e1b..f3240ba8d8 100644
--- a/scripts/lib/wic/filemap.py
+++ b/scripts/lib/wic/filemap.py
@@ -482,7 +482,7 @@ class FilemapFiemap(_FilemapBase):
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:
diff --git a/scripts/lib/wic/msger.py b/scripts/lib/wic/msger.py
index 4d8e704172..fb8336d94a 100644
--- a/scripts/lib/wic/msger.py
+++ b/scripts/lib/wic/msger.py
@@ -148,7 +148,7 @@ def _split_msg(head, msg):
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