[OE-core] [PATCH 5/9] tinderbox.bbclass: Use with to control file handle lifetime

Ola x Nilsson ola.x.nilsson at axis.com
Mon Oct 21 10:30:30 UTC 2019


Signed-off-by: Ola x Nilsson <olani at axis.com>
---
 meta/classes/tinderclient.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/tinderclient.bbclass b/meta/classes/tinderclient.bbclass
index 00f453cec1..f7e41f2959 100644
--- a/meta/classes/tinderclient.bbclass
+++ b/meta/classes/tinderclient.bbclass
@@ -82,8 +82,8 @@ def tinder_format_http_post(d,status,log):
     # we only need on build_status.pl but sending it
     # always does not hurt
     try:
-        f = open(d.getVar('TMPDIR')+'/tinder-machine.id', 'r')
-        id = f.read()
+        with open(d.getVar('TMPDIR') + '/tinder-machine.id') as f:
+            id = f.read()
         variables['machine_id'] = id
     except:
         pass
@@ -231,7 +231,7 @@ def tinder_tinder_start(d, event):
     config = tinder_print_info(d)
     #env    = tinder_print_env()
     time_end   = tinder_time_string()
-    packages = " ".join( event.getPkgs() ) 
+    packages = " ".join( event.getPkgs() )
 
     output = []
     output.append( "---> TINDERBOX PRINTING CONFIGURATION %(time_start)s" )
-- 
2.11.0



More information about the Openembedded-core mailing list