diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-06-29 12:59:26 +0400 |
commit | e192e7e02452c70511f688582d8d95d0a6267ee5 (patch) | |
tree | 75698ba122c3820668888ab38958e5c7e5cbb591 /source/blender/python/api2_2x/Text.c | |
parent | 684869fd74a3a908a5df5802f440bfa823f6c802 (diff) |
remove unneeded checks from the python API
Diffstat (limited to 'source/blender/python/api2_2x/Text.c')
-rw-r--r-- | source/blender/python/api2_2x/Text.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c index c98c542962a..d507d623c99 100644 --- a/source/blender/python/api2_2x/Text.c +++ b/source/blender/python/api2_2x/Text.c @@ -338,26 +338,16 @@ PyObject *Text_CreatePyObject( Text * txt ) /*****************************************************************************/ static PyObject *Text_getFilename( BPy_Text * self ) { - PyObject *attr; - char *name = self->text->name; - - if( name ) - attr = PyString_FromString( self->text->name ); - else - attr = Py_None; - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Text.filename attribute" ); + if( self->text->name ) + return PyString_FromString( self->text->name ); + + Py_RETURN_NONE; } static PyObject *Text_getNLines( BPy_Text * self ) { /* text->nlines isn't updated in Blender (?) */ int nlines = 0; TextLine *line; - PyObject *attr; line = self->text->lines.first; @@ -368,13 +358,7 @@ static PyObject *Text_getNLines( BPy_Text * self ) self->text->nlines = nlines; /* and update Blender, too (should we?) */ - attr = PyInt_FromLong( nlines ); - - if( attr ) - return attr; - - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "couldn't get Text.nlines attribute" ); + return PyInt_FromLong( nlines ); } static PyObject *Text_clear( BPy_Text * self) |