summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-10-15 18:41:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-03 11:18:56 +0000
commit2de98cf4b997e27c6c48be9e3459b7db03b9e093 (patch)
tree60dc0fd16def7739e569c7b4f5ca4486e7151de9
parentabcb68effdbd3440acef35684b1c6ec9a534d955 (diff)
downloadpoky-2de98cf4b997e27c6c48be9e3459b7db03b9e093.tar.gz
testimage: fix unclosed testdata file
(From OE-Core rev: a1e49456343a2be9adb6c0d1d970c2b0c070f53e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0c192a97e3e1c015a48667d6903cc07a8b2620e4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index db1d54e5cb..b1aef626f7 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -229,9 +229,10 @@ def testimage_main(d):
229 229
230 tdname = "%s.testdata.json" % image_name 230 tdname = "%s.testdata.json" % image_name
231 try: 231 try:
232 td = json.load(open(tdname, "r")) 232 with open(tdname, "r") as f:
233 except (FileNotFoundError) as err: 233 td = json.load(f)
234 bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) 234 except FileNotFoundError as err:
235 bb.fatal('File %s not found (%s).\nHave you built the image with INHERIT += "testimage" in the conf/local.conf?' % (tdname, err))
235 236
236 # Some variables need to be updates (mostly paths) with the 237 # Some variables need to be updates (mostly paths) with the
237 # ones of the current environment because some tests require them. 238 # ones of the current environment because some tests require them.