Skip to content

Commit 984bfd8

Browse files
committed
Fix locals for class constructor call
1 parent daf467b commit 984bfd8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

builtin/builtin.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,14 @@ func builtin___build_class__(self py.Object, args py.Tuple, kwargs py.StringDict
214214
} else {
215215
ns = py.Call(prep, py.Tuple{name, bases}, mkw).(py.StringDict)
216216
}
217-
fmt.Printf("Calling %v with %#v and %#v\n", fn.Name, fn.Globals, ns)
218-
cell, err := vm.Run(fn.Globals, ns, fn.Code) // FIXME PyFunction_GET_CLOSURE(fn))
219-
fmt.Printf("result %v %s\n", cell, err)
217+
// fmt.Printf("Calling %v with %p and %p\n", fn.Name, fn.Globals, ns)
218+
// fmt.Printf("Code = %#v\n", fn.Code)
219+
locals := fn.LocalsForCall(py.Tuple{ns})
220+
cell, err := vm.Run(fn.Globals, locals, fn.Code) // FIXME PyFunction_GET_CLOSURE(fn))
221+
222+
// fmt.Printf("result = %#v err = %s\n", cell, err)
223+
// fmt.Printf("locals = %#v\n", locals)
224+
// fmt.Printf("ns = %#v\n", ns)
220225
if err != nil {
221226
// FIXME
222227
panic(err)

0 commit comments

Comments
 (0)