diff options
author | Ross Burton <ross@burtonini.com> | 2021-10-15 18:41:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-29 11:17:26 +0100 |
commit | cfc03f903a05a22cb06e74097e20d8f581df47f2 (patch) | |
tree | 62d898b87815096c16a551ded36d9f6ec3cb07fa /meta | |
parent | 792d4036e27d89a1ec95eaafa22cbcec05431d40 (diff) | |
download | poky-cfc03f903a05a22cb06e74097e20d8f581df47f2.tar.gz |
testimage: fix unclosed testdata file
(From OE-Core rev: 950bafd0ce15309167336d30e0ced6f184284c81)
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 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. |