1.1 --- a/micropython/__init__.py Sun Nov 22 23:34:04 2009 +0100
1.2 +++ b/micropython/__init__.py Sun Nov 22 23:53:30 2009 +0100
1.3 @@ -415,6 +415,13 @@
1.4 if self.finalised:
1.5 return
1.6
1.7 + # Reset any previously compiled information.
1.8 +
1.9 + for module in self.get_modules():
1.10 + module.unfinalise()
1.11 +
1.12 + # Prepare module information again.
1.13 +
1.14 for module in self.get_modules():
1.15 module.finalise()
1.16
2.1 --- a/micropython/data.py Sun Nov 22 23:34:04 2009 +0100
2.2 +++ b/micropython/data.py Sun Nov 22 23:53:30 2009 +0100
2.3 @@ -264,13 +264,10 @@
2.4 l[attr.position] = attr
2.5 return l
2.6
2.7 - def finalise_attributes(self, reset=0):
2.8 + def finalise_attributes(self):
2.9
2.10 "Make sure all attributes are fully defined."
2.11
2.12 - if reset:
2.13 - self.unfinalise_attributes()
2.14 -
2.15 if self.finalised:
2.16 return
2.17
2.18 @@ -713,13 +710,10 @@
2.19
2.20 return NamespaceDict.get_updated_context_values(self, results)
2.21
2.22 - def finalise_attributes(self, reset=0):
2.23 + def finalise_attributes(self):
2.24
2.25 "Make sure that all attributes are fully defined."
2.26
2.27 - if reset:
2.28 - self.unfinalise_attributes()
2.29 -
2.30 if self.finalised:
2.31 return
2.32
2.33 @@ -1148,7 +1142,7 @@
2.34 return 1
2.35 return 0
2.36
2.37 - def finalise_attributes(self, reset=0):
2.38 + def finalise_attributes(self):
2.39
2.40 """
2.41 Make sure all attributes (locals) are fully defined. Note that locals
2.42 @@ -1156,9 +1150,6 @@
2.43 Defaults are also finalised by this method.
2.44 """
2.45
2.46 - if reset:
2.47 - self.unfinalise_attributes()
2.48 -
2.49 if self.finalised:
2.50 return
2.51
3.1 --- a/micropython/inspect.py Sun Nov 22 23:34:04 2009 +0100
3.2 +++ b/micropython/inspect.py Sun Nov 22 23:53:30 2009 +0100
3.3 @@ -230,12 +230,19 @@
3.4 if isinstance(value, Class):
3.5 self.vacuum_object(value, 1)
3.6
3.7 + def unfinalise(self):
3.8 +
3.9 + "Reset finalised information for the module."
3.10 +
3.11 + for obj in self.all_objects:
3.12 + obj.unfinalise_attributes()
3.13 +
3.14 def finalise(self):
3.15
3.16 "Finalise the module."
3.17
3.18 for obj in self.all_objects:
3.19 - obj.finalise_attributes(reset=1)
3.20 + obj.finalise_attributes()
3.21
3.22 def add_object(self, obj, any_scope=0):
3.23