]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sstatesig: fix netrc.NetrcParseError exception
authorJose Quaresma <quaresma.jose@gmail.com>
Thu, 4 Apr 2024 09:45:57 +0000 (10:45 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Apr 2024 20:50:21 +0000 (21:50 +0100)
Looks like sometimes the e.filename and the e.lineno is not properly set by the netrc
and this can cause TypeError.

| File "/poky/meta/lib/oe/sstatesig.py", line 342, in init_rundepcheck
|     bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, e.msg))
|             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| TypeError: %d format: a real number is required, not NoneType

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/sstatesig.py

index b9aa39cdccf9446fd490681f9af61ceb5362d750..a46e5502ab3a5ff0706239ad618cf11aa78049b4 100644 (file)
@@ -339,7 +339,7 @@ class SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.sigge
             except FileNotFoundError:
                 pass
             except netrc.NetrcParseError as e:
-                bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, e.msg))
+                bb.warn("Error parsing %s:%s: %s" % (e.filename, str(e.lineno), e.msg))
 
 # Insert these classes into siggen's namespace so it can see and select them
 bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash