See equivalent change for OCaml in
commit d881d160e1cd9c9964782300a7652ffb4e506c27.
---
generator/generator | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator/generator b/generator/generator
index 0107724..0523f0a 100755
--- a/generator/generator
+++ b/generator/generator
@@ -4135,7 +4135,8 @@ let print_python_binding name { args; optargs; ret; may_set_error }
=
pr " Py_DECREF (py_args);\n";
pr "\n";
pr " if (py_ret != NULL) {\n";
- pr " Py_DECREF (py_ret); /* return value is discarded */\n";
+ pr " ret = PyLong_AsLong (py_ret);\n";
+ pr " Py_DECREF (py_ret);\n";
pr " }\n";
pr " else {\n";
pr " ret = -1;\n";
--
2.22.0