summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/tinfoil.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 5755e5a346..2fb1bb7d27 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -806,18 +806,22 @@ class Tinfoil:
806 prepare() has been called, or use a with... block when you create 806 prepare() has been called, or use a with... block when you create
807 the tinfoil object which will ensure that it gets called. 807 the tinfoil object which will ensure that it gets called.
808 """ 808 """
809 if self.server_connection: 809 try:
810 self.run_command('clientComplete') 810 if self.server_connection:
811 _server_connections.remove(self.server_connection) 811 try:
812 bb.event.ui_queue = [] 812 self.run_command('clientComplete')
813 self.server_connection.terminate() 813 finally:
814 self.server_connection = None 814 _server_connections.remove(self.server_connection)
815 815 bb.event.ui_queue = []
816 # Restore logging handlers to how it looked when we started 816 self.server_connection.terminate()
817 if self.oldhandlers: 817 self.server_connection = None
818 for handler in self.logger.handlers: 818
819 if handler not in self.oldhandlers: 819 finally:
820 self.logger.handlers.remove(handler) 820 # Restore logging handlers to how it looked when we started
821 if self.oldhandlers:
822 for handler in self.logger.handlers:
823 if handler not in self.oldhandlers:
824 self.logger.handlers.remove(handler)
821 825
822 def _reconvert_type(self, obj, origtypename): 826 def _reconvert_type(self, obj, origtypename):
823 """ 827 """