diff mbox series

bitbake-layers: use 'with' to manage tinfoil context

Message ID 20241125210601.1752450-1-chris.laplante@agilent.com
State Accepted, archived
Commit bd468a5b9210043d0121a322360d976fd830f736
Headers show
Series bitbake-layers: use 'with' to manage tinfoil context | expand

Commit Message

chris.laplante@agilent.com Nov. 25, 2024, 9:06 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 bin/bitbake-layers | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 613e675cb..7bd3ea20e 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -57,9 +57,9 @@  def main():
                          level=logger.getEffectiveLevel())
 
     plugins = []
-    tinfoil = bb.tinfoil.Tinfoil(tracking=True)
-    tinfoil.logger.setLevel(logger.getEffectiveLevel())
-    try:
+    with bb.tinfoil.Tinfoil(tracking=True) as tinfoil:
+        tinfoil.logger.setLevel(logger.getEffectiveLevel())
+
         if global_args.force > 1:
             bbpaths = []
         else:
@@ -90,8 +90,6 @@  def main():
             tinfoil.config_data.enableTracking()
 
         return args.func(args)
-    finally:
-        tinfoil.shutdown()
 
 
 if __name__ == "__main__":