diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-02-17 10:15:11 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-02-17 10:15:11 +0000 |
commit | a803cc710b85cca3baf920011e3ea39397ca117c (patch) | |
tree | 31d26a614b8b888f9ac100e52e781768ef74a8f1 /bindings/python/lang.py | |
parent | 7c1bd8f0bab3de9581e406a9995071841c52b652 (diff) | |
download | lasso-a803cc710b85cca3baf920011e3ea39397ca117c.tar.gz lasso-a803cc710b85cca3baf920011e3ea39397ca117c.tar.xz lasso-a803cc710b85cca3baf920011e3ea39397ca117c.zip |
Binding python: simplify special constructor, use cptrToPy
Diffstat (limited to 'bindings/python/lang.py')
-rw-r--r-- | bindings/python/lang.py | 6 |
1 files changed, 1 insertions, 5 deletions
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 |