From a803cc710b85cca3baf920011e3ea39397ca117c Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 17 Feb 2010 10:15:11 +0000 Subject: Binding python: simplify special constructor, use cptrToPy --- bindings/python/lang.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'bindings/python/lang.py') diff --git a/bindings/python/lang.py b/bindings/python/lang.py index c8037198..b3ca2b68 100644 --- a/bindings/python/lang.py +++ b/bindings/python/lang.py @@ -361,11 +361,7 @@ if WSF_SUPPORT: py_args = ', ' + ', '.join(py_args) print >> fd, ' @classmethod' print >> fd, ' def %s(cls%s):' % (constructor_name, py_args) - print >> fd, ' obj = cls.__new__(cls)' - print >> fd, ' obj._cptr = _lasso.%s(%s)' % (m.name[6:], c_args) - print >> fd, ' if obj._cptr is None:' - print >> fd, ' raise RuntimeError(\'lasso failed to create object\')' - print >> fd, ' return obj' + print >> fd, ' return cptrToPy(_lasso.%s(%s))' % (m.name[6:], c_args) print >> fd, '' # create properties for members -- cgit