From 60bc045cc318300c2bcb5b2e883ff840a7305260 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Tue, 29 Apr 2008 12:04:12 +0000 Subject: [project @ fpeters@0d.be-20071101155155-avzyxfeum84mhf7k] don't return a value for methods that do not return a value, and convert returned value to object for methods returning objects. Original author: Frederic Peters Date: 2007-11-01 16:51:55.007000+01:00 --- bindings/lang_python.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/lang_python.py b/bindings/lang_python.py index e624b17d..b9691398 100644 --- a/bindings/lang_python.py +++ b/bindings/lang_python.py @@ -303,7 +303,7 @@ import lasso print >> fd, " '''" print >> fd, self.format_docstring(m, mname, 8) print >> fd, " '''" - if m.return_type == 'void': + if m.return_type in (None, 'void'): print >> fd, ' _lasso.%s(self._cptr%s)' % ( m.name[6:], c_args) elif m.return_type in ('gint', 'int'): @@ -315,6 +315,9 @@ import lasso print >> fd, ' return rc' print >> fd, ' elif rc < 0:' # unrecoverable error print >> fd, ' raise Error.raise_on_rc(rc)' + elif self.is_pygobject(m.return_type): + print >> fd, ' return cptrToPy(_lasso.%s(self._cptr%s))' % ( + m.name[6:], c_args) else: print >> fd, ' return _lasso.%s(self._cptr%s)' % ( m.name[6:], c_args) -- cgit