bind: use python case for booleans

Fixes #207.
This commit is contained in:
Sebastien Binet 2019-12-30 16:54:23 +01:00
parent 3b145be9f2
commit c29e95e5ce
1 changed files with 8 additions and 1 deletions

View File

@ -110,5 +110,12 @@ func (g *pyGen) genVarSetter(v *Var) {
func (g *pyGen) genConstValue(c *Const) {
// constants go directly into wrapper as-is
g.pywrap.Printf("%s = %s\n", c.GoName(), c.obj.Val().ExactString())
val := c.obj.Val().ExactString()
switch val {
case "true":
val = "True"
case "false":
val = "False"
}
g.pywrap.Printf("%s = %s\n", c.GoName(), val)
}