summaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-10-15 18:41:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-17 11:56:32 +0100
commitb3fd59873d21ff2dd3807d0c8b99fab248b1e220 (patch)
treefe6c4003bae423eb7665a17a9e873f7f2dbcf163 /meta/classes/testimage.bbclass
parent663a7d657405b250d183d1c564b7bbb57bd1ad14 (diff)
downloadpoky-b3fd59873d21ff2dd3807d0c8b99fab248b1e220.tar.gz
testimage: fix unclosed testdata file
(From OE-Core rev: 0c192a97e3e1c015a48667d6903cc07a8b2620e4) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-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 a76e773853..4db05a4af4 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -235,9 +235,10 @@ def testimage_main(d):
235 235
236 tdname = "%s.testdata.json" % image_name 236 tdname = "%s.testdata.json" % image_name
237 try: 237 try:
238 td = json.load(open(tdname, "r")) 238 with open(tdname, "r") as f:
239 except (FileNotFoundError) as err: 239 td = json.load(f)
240 bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) 240 except FileNotFoundError as err:
241 bb.fatal('File %s not found (%s).\nHave you built the image with INHERIT += "testimage" in the conf/local.conf?' % (tdname, err))
241 242
242 # Some variables need to be updates (mostly paths) with the 243 # Some variables need to be updates (mostly paths) with the
243 # ones of the current environment because some tests require them. 244 # ones of the current environment because some tests require them.