sstatesig: fix netrc.NetrcParseError exception

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

(From OE-Core rev: 486ed69939f1b7572f121960c2dde246032686e7)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jose Quaresma
2024-04-04 10:45:57 +01:00
committed by Richard Purdie
parent ab6d3e3d64
commit 110ee701b3

View 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