[bitbake-devel,1.38] COW: Fix StopIteration warning

Submitted by luca.boccassi@gmail.com on March 13, 2019, 8 p.m. | Patch ID: 159554

Details

Message ID 20190313200003.12020-1-luca.boccassi@gmail.com
State New
Headers show

Commit Message

luca.boccassi@gmail.com March 13, 2019, 8 p.m.
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Fix the warning:

WARNING: lib/bb/data_smart.py:235: DeprecationWarning: generator 'COWDictMeta.iter' raised StopIteration
  for k, v in self.variables.iteritems():

by using return from the generator, not raising StopIteration.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 407d6e07b09123c12c382b4a92107f002c314b05)
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
Backporting this patch to 1.38 fixes running bitbake on Sumo on Debian
10, which about to become the new Debian stable.

 lib/bb/COW.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/COW.py b/lib/bb/COW.py
index bec62080..7817473a 100644
--- a/lib/bb/COW.py
+++ b/lib/bb/COW.py
@@ -150,7 +150,7 @@  class COWDictMeta(COWMeta):
                 yield value
             if type == "items":
                 yield (key, value)
-        raise StopIteration()
+        return
 
     def iterkeys(cls):
         return cls.iter("keys")