summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2007-08-13 13:39:22 -0700
committerNathan Binkert <nate@binkert.org>2007-08-13 13:39:22 -0700
commit9b4be6532741a511ca8f9e1d051269245814be8b (patch)
treeff09aa8f1f47b6bf6bd82dbcf3be1d22a2392efd
parentce219738b9f0ae569686ba8237538bf285eadbdf (diff)
downloadgem5-9b4be6532741a511ca8f9e1d051269245814be8b.tar.xz
python: make the DictImporter's unload() work in any context.
import sys since sys may not be defined in whatever context the DictImporter is used. Also reset self.installed after an unload since the same DictImporter could be used again --HG-- extra : convert_revision : 988ed7ad8cd41b69e8fc583e618b1b4a146216da
-rw-r--r--src/python/generate.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/python/generate.py b/src/python/generate.py
index 6b167552e..7c6ca1c5e 100644
--- a/src/python/generate.py
+++ b/src/python/generate.py
@@ -46,8 +46,10 @@ class DictImporter(object):
self.unload()
def unload(self):
+ import sys
for module in self.installed:
del sys.modules[module]
+ self.installed = set()
def find_module(self, fullname, path):
if fullname == '__scons':