diff options
author | Ross Burton <ross@burtonini.com> | 2021-10-15 18:41:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-03 11:19:04 +0000 |
commit | 49a08ab98d511210192dcd4d4fe61fc9aed497c9 (patch) | |
tree | 92dc3182e72c9eddcb3ebc4e8abb3955f83c5c0c /meta | |
parent | 941fc8d40ad1694c135f935e38d18707424e180b (diff) | |
download | poky-49a08ab98d511210192dcd4d4fe61fc9aed497c9.tar.gz |
testimage: fix unclosed testdata file
(From OE-Core rev: 0392005d2ed9648ed6eedd3dd3541249bf4fc404)
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: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/testimage.bbclass | 7 |
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. |