Signed-off-by: Chris Laplante <[email protected]>
---
 classes/xsctyaml.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/classes/xsctyaml.bbclass b/classes/xsctyaml.bbclass
index 2f41802..bebc3fe 100644
--- a/classes/xsctyaml.bbclass
+++ b/classes/xsctyaml.bbclass
@@ -111,10 +111,9 @@ python do_create_yaml() {
 
     if len(yaml_dict) != 0:
         fp = d.getVar("YAML_FILE_PATH")
-        if fp :
-            yamlfile = open(fp, 'w')
-            yamlfile.write(yaml.dump(yaml_dict, default_flow_style=True, 
width=2000))
-            yamlfile.close()
+        if fp:
+            with open(fp, 'w') as yamlfile:
+                yamlfile.write(yaml.dump(yaml_dict, default_flow_style=True, 
width=2000))
 }
 
 addtask create_yaml after do_prepare_recipe_sysroot before do_configure
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#4916): 
https://lists.yoctoproject.org/g/meta-xilinx/message/4916
Mute This Topic: https://lists.yoctoproject.org/mt/85253272/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • [meta-xilinx] [meta-xilinx-tools... Chris Laplante via lists.yoctoproject.org

Reply via email to