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:
authorCampbell Barton <ideasman42@gmail.com>2009-09-28 09:02:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-28 09:02:09 +0400
commit92ee7ca94659783230ae1d10ab63ab7684718e8f (patch)
tree7fe6ee75c4178c33853a7d22643cc0593f3cf49c
parentdab61acd458ef53eee2df014ccb28579b947ec5b (diff)
remove warnings, print errors if bpy_ops.py or bpy_sys.py fail to import
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp2
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c3
-rw-r--r--source/blender/python/intern/bpy_interface.c28
3 files changed, 15 insertions, 18 deletions
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp
index bc9598d6c81..255d1d2f1f6 100644
--- a/intern/audaspace/intern/AUD_C-API.cpp
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -540,6 +540,8 @@ int AUD_setDeviceVolume(AUD_Device* device, float volume)
return device->setCapability(AUD_CAPS_VOLUME, &volume);
}
catch(AUD_Exception) {}
+
+ return false;
}
int AUD_setDeviceSoundVolume(AUD_Device* device, AUD_Handle* handle,
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index d8466337781..6e37014a771 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -109,9 +109,6 @@ static void rna_Mesh_calc_edges(Mesh *mesh)
static void rna_Mesh_update(Mesh *mesh, bContext *C)
{
- Main *bmain= CTX_data_main(C);
- Object *ob;
-
if(mesh->totface && mesh->totedge == 0)
rna_Mesh_calc_edges(mesh);
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 675ef973ca2..d0829acd6cc 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -147,6 +147,17 @@ void bpy_context_clear(bContext *C, PyGILState_STATE *gilstate)
}
}
+static void bpy_import_test(char *modname)
+{
+ PyObject *mod= PyImport_ImportModuleLevel(modname, NULL, NULL, NULL, 0);
+ if(mod) {
+ Py_DECREF(mod);
+ }
+ else {
+ PyErr_Print();
+ PyErr_Clear();
+ }
+}
void BPY_free_compiled_text( struct Text *text )
{
@@ -187,21 +198,8 @@ static void bpy_init_modules( void )
Py_DECREF(py_modpath);
}
- mod= PyImport_ImportModuleLevel("bpy_ops", NULL, NULL, NULL, 0); /* adds its self to bpy.ops */
- if(mod) {
- Py_DECREF(mod);
- }
- else {
- PyErr_Clear();
- }
-
- mod= PyImport_ImportModuleLevel("bpy_sys", NULL, NULL, NULL, 0); /* adds its self to bpy.sys */
- if(mod) {
- Py_DECREF(mod);
- }
- else {
- PyErr_Clear();
- }
+ bpy_import_test("bpy_ops"); /* adds its self to bpy.ops */
+ bpy_import_test("bpy_sys"); /* adds its self to bpy.sys */
}
/* stand alone utility modules not related to blender directly */