Skip to content

Commit c29e95e

Browse files
committed
bind: use python case for booleans
Fixes #207.
1 parent 3b145be commit c29e95e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bind/gen_varconst.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,12 @@ func (g *pyGen) genVarSetter(v *Var) {
110110

111111
func (g *pyGen) genConstValue(c *Const) {
112112
// constants go directly into wrapper as-is
113-
g.pywrap.Printf("%s = %s\n", c.GoName(), c.obj.Val().ExactString())
113+
val := c.obj.Val().ExactString()
114+
switch val {
115+
case "true":
116+
val = "True"
117+
case "false":
118+
val = "False"
119+
}
120+
g.pywrap.Printf("%s = %s\n", c.GoName(), val)
114121
}

0 commit comments

Comments
 (0)