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:
authorKen Hughes <khughes@pacific.edu>2007-01-23 01:59:34 +0300
committerKen Hughes <khughes@pacific.edu>2007-01-23 01:59:34 +0300
commit42ef81d88b52ed3060d5969394786a982f94a87e (patch)
tree030fe0d2ad25484b1f356ecf9301025f3cefe785 /source/blender/python/api2_2x/Library.c
parent5dd1a39288e4fff124ef4ce013ae55da4ff73e87 (diff)
Python API
---------- Bugfix #3233: throw an IOError exception in Library.Open() if the specified library file cannot be opened. This had been changed to a "feature request" but should have been a bug, even though it worked as documented (or rather, the documentation described what the function did).
Diffstat (limited to 'source/blender/python/api2_2x/Library.c')
-rw-r--r--source/blender/python/api2_2x/Library.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c
index 30db91fce25..5d5075891ee 100644
--- a/source/blender/python/api2_2x/Library.c
+++ b/source/blender/python/api2_2x/Library.c
@@ -158,7 +158,7 @@ PyObject *M_Library_Open( PyObject * self, PyObject * args )
Py_DECREF( Py_None ); /* incref'ed by above function */
}
- /* copy the name to make it absolute so BLO_blendhandle_from_file dosnt complain */
+ /* copy the name to make it absolute so BLO_blendhandle_from_file doesn't complain */
BLI_strncpy(fname1, fname, sizeof(fname1));
BLI_convertstringcode(fname1, G.sce, 0); /* make absolute */
@@ -167,10 +167,9 @@ PyObject *M_Library_Open( PyObject * self, PyObject * args )
bpy_openlib = BLO_blendhandle_from_file( fname1 );
BLI_strncpy(G.sce, filename, sizeof(filename));
-
if( !bpy_openlib )
- return Py_BuildValue( "i", 0 );
-
+ return EXPP_ReturnPyObjError( PyExc_IOError, "file not found" );
+
/* "//someblend.blend" enables relative paths */
if (sizeof(fname) > 2 && fname[0] == '/' && fname[1] == '/')
bpy_relative= 1; /* global that makes the library relative on loading */
@@ -200,8 +199,7 @@ PyObject *M_Library_Close( PyObject * self )
bpy_openlibname = NULL;
}
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
/**