# HG changeset patch # User Paul Boddie # Date 1234040664 -3600 # Node ID 7d3226e3d4f7eaed91aba256dc040d8dd78eaeb1 # Parent 5c8320ec4c464d0f0f325acf3be41e8cb54cdd3c Fixed raw object positioning for functions with static defaults. diff -r 5c8320ec4c46 -r 7d3226e3d4f7 micropython/__init__.py --- a/micropython/__init__.py Mon Feb 02 01:34:35 2009 +0100 +++ b/micropython/__init__.py Sat Feb 07 22:04:24 2009 +0100 @@ -223,8 +223,11 @@ if not with_builtins and item.module.name == "__builtins__": item.code_location = item.full_name() + + # Skip any defaults. + else: - item.code_location = pos + item.code_location = pos + len(item.defaults) elif isinstance(item, micropython.data.Const): pos += len(self.raw_data(item)) @@ -309,7 +312,7 @@ # Check the code location only where the code has been generated. assert (not with_builtins and item.module.name == "__builtins__") or \ - item.code_location == len(self.raw_code) + item.code_location == len(self.raw_code) + len(item.defaults) elif isinstance(item, micropython.data.Module): assert item.location == len(self.raw_code)