Skip to contentSkip to conversation

COW: Fix StopIteration warning

PATCH New [email protected] 1 participant 1 message Mar 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 COW: Fix StopIteration warning

From: Richard Purdie <[email protected]>

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.

(cherry picked from commit 407d6e07b09123c12c382b4a92107f002c314b05)

---
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(-)
lib/bb/COW.py +1 -1
index bec62080..7817473a 100644
@@ -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")
Signature · 1 line
2.20.1