Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Swaney <sswaney@centurytel.net>2006-01-14 05:13:15 +0300
committerStephen Swaney <sswaney@centurytel.net>2006-01-14 05:13:15 +0300
commitadcef46599a163576984bb229e3f588c47572101 (patch)
treed9cb087d3baea7d0bbcacb932208f52bcb2af0e3 /source/blender
parentc18db96f56dce8cdb2507fc6556b0e7521ddea9a (diff)
Object.Get( name ) was throwing an AttributeError.
Change to throw more correct ValueError when name is not found as per IRC discussion
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/python/api2_2x/Object.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index f9b63c63a84..18fe85712f9 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -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 {