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 );
|
||||
|
||||
/* No object exists with the name specified in the argument name. */
|
||||
if( !object )
|
||||
return EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"Unknown object specified." );
|
||||
if( !object ){
|
||||
char buffer[128];
|
||||
PyOS_snprintf( buffer, sizeof(buffer),
|
||||
"object \"%s\" not found", name);
|
||||
return EXPP_ReturnPyObjError( PyExc_ValueError,
|
||||
buffer );
|
||||
}
|
||||
|
||||
return Object_CreatePyObject( object );
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user