1.1 --- a/micropython/__init__.py Sun Feb 17 02:38:04 2008 +0100
1.2 +++ b/micropython/__init__.py Mon Feb 18 01:22:25 2008 +0100
1.3 @@ -62,7 +62,7 @@
1.4
1.5 self.path = path or [os.getcwd()]
1.6 self.verbose = verbose
1.7 - self.modules = {}
1.8 + self.modules = {"__builtins__" : micropython.inspect.builtins}
1.9 self.loading = set()
1.10
1.11 def vacuum(self):
1.12 @@ -81,7 +81,7 @@
1.13
1.14 return self.modules.values()
1.15
1.16 - def get_image(self, objtable=None, paramtable=None):
1.17 + def get_image(self, objtable=None, paramtable=None, with_builtins=0):
1.18
1.19 "Return a dictionary mapping modules to structures."
1.20
1.21 @@ -91,6 +91,9 @@
1.22 image = []
1.23
1.24 for module_name, module in self.modules.items():
1.25 + if not with_builtins and module_name == "__builtins__":
1.26 + continue
1.27 +
1.28 pos = len(image)
1.29
1.30 # Position the module in the image and make a translation.
1.31 @@ -155,7 +158,7 @@
1.32
1.33 # Append the function code to the image.
1.34
1.35 - obj.code_location = obj.location = pos
1.36 + obj.code_location = pos
1.37 code = trans.get_code(obj)
1.38 image += code
1.39 pos += len(code)