10000 Fix __build_class__ so that it passes its locals properly · go-python/gpython@a7d0488 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7d0488

Browse files
committed
Fix __build_class__ so that it passes its locals properly
1 parent 9524f0b commit a7d0488

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/builtin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package builtin
33

44
import (
55
"fmt"
6+
"unicode/utf8"
7+
68
"github.com/ncw/gpython/compile"
79
"github.com/ncw/gpython/py"
810
"github.com/ncw/gpython/vm"
9-
"unicode/utf8"
1011
)
1112

1213
const builtin_doc = `Built-in functions, exceptions, and other objects.
@@ -277,10 +278,9 @@ func builtin___build_class__(self py.Object, args py.Tuple, kwargs py.StringDict
277278
} else {
278279
ns = py.Call(prep, py.Tuple{name, bases}, mkw).(py.StringDict)
279280
}
280-
// fmt.Printf("Calling %v with %p and %p\n", fn.Name, fn.Globals, ns)
281+
// fmt.Printf("Calling %v with %v and %v\n", fn.Name, fn.Globals, ns)
281282
// fmt.Printf("Code = %#v\n", fn.Code)
282-
locals := fn.LocalsForCall(py.Tuple{ns})
283-
cell, err := vm.Run(fn.Globals, locals, fn.Code, fn.Closure)
283+
cell, err := vm.Run(fn.Globals, ns, fn.Code, fn.Closure)
284284

285285
// fmt.Printf("result = %#v err = %s\n", cell, err)
286286
// fmt.Printf("locals = %#v\n", locals)

0 commit comments

Comments
 (0)
0