Skip to content

Commit 6461be4

Browse files
Correcting npyres computation.
1 parent c033c82 commit 6461be4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bind/gen_func.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ func (g *pyGen) genFuncSig(sym *symbol, fsym *Func) bool {
6161
nargs := 0
6262
nres := len(res)
6363
npyres := nres
64+
rvHasErr := false // set to true if the main return is an error
6465
if fsym.haserr {
65-
npyres -= 1
66+
if NoPyExceptions {
67+
rvHasErr = true
68+
} else {
69+
npyres -= 1
70+
}
6671
}
6772

6873
var (

0 commit comments

Comments
 (0)