forked from bartvdbraak/blender
Object.Get( name ) was throwing an AttributeError.
Change to throw more correct ValueError when name is not found as per IRC discussion
This commit is contained in:
parent
c18db96f56
commit
adcef46599
@ -730,9 +730,13 @@ PyObject *M_Object_Get( PyObject * self, PyObject * args )
|
|||||||
object = GetObjectByName( name );
|
object = GetObjectByName( name );
|
||||||
|
|
||||||
/* No object exists with the name specified in the argument name. */
|
/* No object exists with the name specified in the argument name. */
|
||||||
if( !object )
|
if( !object ){
|
||||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
char buffer[128];
|
||||||
"Unknown object specified." );
|
PyOS_snprintf( buffer, sizeof(buffer),
|
||||||
|
"object \"%s\" not found", name);
|
||||||
|
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||||
|
buffer );
|
||||||
|
}
|
||||||
|
|
||||||
return Object_CreatePyObject( object );
|
return Object_CreatePyObject( object );
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user