1.1 --- a/micropython/common.py Sat Jun 12 23:09:30 2010 +0200
1.2 +++ b/micropython/common.py Sun Jun 13 02:24:35 2010 +0200
1.3 @@ -38,7 +38,13 @@
1.4 except NodeProcessingError, exc:
1.5 if exc.astnode is None:
1.6 exc.astnode = node
1.7 - exc.unit_name = self.full_name()
1.8 +
1.9 + # NOTE: Should perhaps specialise the subclasses appropriately.
1.10 +
1.11 + if hasattr(self, "unit"):
1.12 + exc.unit_name = self.unit.full_name()
1.13 + else:
1.14 + exc.unit_name = self.full_name()
1.15 raise
1.16
1.17 # Errors.