From 9b7ab632e47d786dd979262015dbfb1254103f83 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 4 May 2016 16:06:27 +0300 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/wic/msger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/lib/wic/msger.py') 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 -- cgit v1.2.3