1.1 --- a/micropython/__init__.py Thu Aug 21 00:49:15 2008 +0200
1.2 +++ b/micropython/__init__.py Fri Aug 22 00:50:59 2008 +0200
1.3 @@ -65,6 +65,7 @@
1.4 self.path = path or [os.getcwd()]
1.5 self.verbose = verbose
1.6 self.modules = {}
1.7 + self.modules_ordered = []
1.8 self.loading = set()
1.9
1.10 # Remember the tables once generated.
1.11 @@ -124,8 +125,9 @@
1.12 const.location = pos
1.13 image.append(const)
1.14
1.15 - for module_name, module in self.modules.items():
1.16 - if not with_builtins and module_name == "__builtins__":
1.17 + for module in self.modules_ordered:
1.18 +
1.19 + if not with_builtins and module.name == "__builtins__":
1.20 continue
1.21
1.22 # Fix the attributes.
1.23 @@ -475,6 +477,7 @@
1.24
1.25 if not self.modules.has_key(module_name):
1.26 self.modules[module_name] = module = micropython.inspect.InspectedModule(module_name, self)
1.27 + self.modules_ordered.append(module)
1.28 else:
1.29 module = self.modules[module_name]
1.30 return module