Skip to contentSkip to conversation

Paul Eggleton : bitbake-layers: close files in apply_append()

PATCH [email protected] 2 participants 2 messages Jan 10, 2012

lore
Share & tools
lore
#0 lore raw
Module: bitbake.git
Branch: master
Commit: 470a160813ce6cf04f83258d46ded5c2ab8bc520
URL:    http://git.openembedded.org/?p=bitbake.git&a=commit;h=470a160813ce6cf04f83258d46ded5c2ab8bc520
Author: Paul Eggleton <[email protected]>
Date:   Sun Jan  8 12:06:51 2012 +0000

bitbake-layers: close files in apply_append()

It's recommended practice to close files when finished with them and the code in this function was not doing this.

---

 bin/bitbake-layers |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
bin/bitbake-layers +2 -0
index b4c4127..b4cfd55 100755
@@ -307,6 +307,8 @@ build results (as the layer priority order has effectively changed).
         recipefile.write('\n')
         recipefile.write('##### bbappended from %s #####\n' % self.get_append_layer(appendname))
         recipefile.writelines(appendfile.readlines())
+        recipefile.close()
+        appendfile.close()
 
     def do_show_appends(self, args):
         """list bbappend files and recipe files they apply to
#1 lore raw
Quoted 8 lines · On Tue, Jan 10, 2012 at 10:49 AM, <[email protected]> wrote:

Module: bitbake.git
Branch: master
Commit: 470a160813ce6cf04f83258d46ded5c2ab8bc520
URL:    http://git.openembedded.org/?p=bitbake.git&a=commit;h=470a160813ce6cf04f83258d46ded5c2ab8bc520

Author: Paul Eggleton <[email protected]>
Date:   Sun Jan  8 12:06:51 2012 +0000

Quoted 7 lines

bitbake-layers: close files in apply_append()

It's recommended practice to close files when finished with them and the code in this function was not doing this.

Given we require 2.6, fyi, you could use the context manager.

Signature · 1 line
Christopher Larson