summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 1359d33f77..0d29aa03a0 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -159,6 +159,9 @@ class BBCooker:
159 for f in featureSet: 159 for f in featureSet:
160 self.featureset.setFeature(f) 160 self.featureset.setFeature(f)
161 161
162 self.orig_syspath = sys.path.copy()
163 self.orig_sysmodules = [*sys.modules]
164
162 self.configuration = bb.cookerdata.CookerConfiguration() 165 self.configuration = bb.cookerdata.CookerConfiguration()
163 166
164 self.idleCallBackRegister = idleCallBackRegister 167 self.idleCallBackRegister = idleCallBackRegister
@@ -350,6 +353,11 @@ class BBCooker:
350 self.state = state.initial 353 self.state = state.initial
351 self.caches_array = [] 354 self.caches_array = []
352 355
356 sys.path = self.orig_syspath.copy()
357 for mod in [*sys.modules]:
358 if mod not in self.orig_sysmodules:
359 del sys.modules[mod]
360
353 # Need to preserve BB_CONSOLELOG over resets 361 # Need to preserve BB_CONSOLELOG over resets
354 consolelog = None 362 consolelog = None
355 if hasattr(self, "data"): 363 if hasattr(self, "data"):