summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 e613759503..538ec4fc8a 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -230,9 +230,10 @@ def testimage_main(d):
230 230
231 tdname = "%s.testdata.json" % image_name 231 tdname = "%s.testdata.json" % image_name
232 try: 232 try:
233 td = json.load(open(tdname, "r")) 233 with open(tdname, "r") as f:
234 except (FileNotFoundError) as err: 234 td = json.load(f)
235 bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) 235 except FileNotFoundError as err:
236 bb.fatal('File %s not found (%s).\nHave you built the image with INHERIT += "testimage" in the conf/local.conf?' % (tdname, err))
236 237
237 # Some variables need to be updates (mostly paths) with the 238 # Some variables need to be updates (mostly paths) with the
238 # ones of the current environment because some tests require them. 239 # ones of the current environment because some tests require them.