# HG changeset patch # User Paul Boddie # Date 1473112432 -7200 # Node ID ced5eba497fd79cbcd07a7af0f1c4ec2200b810a # Parent 6e22f2d871b78e7270cb7e882615e07acfd034c1 Convert function local references where invocation results apply. diff -r 6e22f2d871b7 -r ced5eba497fd resolving.py --- a/resolving.py Mon Sep 05 23:38:33 2016 +0200 +++ b/resolving.py Mon Sep 05 23:53:52 2016 +0200 @@ -117,12 +117,10 @@ ref = self.convert_invocation(ref) self.importer.objects[key] = self.objects[key] = ref - # Rewrite function defaults, which are effectively extra members of the - # module. + # Convert function defaults, which are effectively extra members of the + # module, and function locals. - defaults = self.function_defaults.items() - - for fname, parameters in defaults: + for fname, parameters in self.function_defaults.items(): l = [] for pname, ref in parameters: if ref.has_kind(""): @@ -130,6 +128,14 @@ l.append((pname, ref)) self.function_defaults[fname] = l + # Convert function locals referencing invocations. + + for fname, names in self.function_locals.items(): + for name, ref in names.items(): + if ref.has_kind(""): + ref = self.convert_invocation(ref) + names[name] = ref + def convert_invocation(self, ref): "Convert the given invocation 'ref', handling instantiation."