[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35763] trunk/blender: fix for incorrect prints with RNA errors (own fault, CONTAINER_RNA_ID was incorrect) & close keymap file after running.

Campbell Barton ideasman42 at gmail.com
Fri Mar 25 02:55:02 CET 2011


Revision: 35763
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35763
Author:   campbellbarton
Date:     2011-03-25 01:55:00 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
fix for incorrect prints with RNA errors (own fault, CONTAINER_RNA_ID was incorrect) & close keymap file after running.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/utils.py
    trunk/blender/source/blender/makesrna/intern/rna_internal_types.h
    trunk/blender/source/blender/python/intern/bpy_interface.c

Modified: trunk/blender/release/scripts/modules/bpy/utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/utils.py	2011-03-25 00:34:28 UTC (rev 35762)
+++ trunk/blender/release/scripts/modules/bpy/utils.py	2011-03-25 01:55:00 UTC (rev 35763)
@@ -352,7 +352,9 @@
     keyconfigs_old = keyconfigs[:]
 
     try:
-        exec(compile(open(filepath).read(), filepath, 'exec'), {"__file__": filepath})
+        file = open(filepath)
+        exec(compile(file.read(), filepath, 'exec'), {"__file__": filepath})
+        file.close()
     except:
         import traceback
         traceback.print_exc()

Modified: trunk/blender/source/blender/makesrna/intern/rna_internal_types.h
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_internal_types.h	2011-03-25 00:34:28 UTC (rev 35762)
+++ trunk/blender/source/blender/makesrna/intern/rna_internal_types.h	2011-03-25 01:55:00 UTC (rev 35763)
@@ -346,6 +346,6 @@
 	ListBase structs;
 };
 
-#define CONTAINER_RNA_ID(cont) (const char *)(((ContainerRNA *)(cont))+1)
+#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont))+1))
 
 #endif /* RNA_INTERNAL_TYPES_H */

Modified: trunk/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_interface.c	2011-03-25 00:34:28 UTC (rev 35762)
+++ trunk/blender/source/blender/python/intern/bpy_interface.c	2011-03-25 01:55:00 UTC (rev 35763)
@@ -235,7 +235,7 @@
 	utf8towchar(bprogname_wchar, bprogname);
 	Py_SetProgramName(bprogname_wchar);
 
-	/* builtin modules */
+	/* must run before python initializes */
 	PyImport_ExtendInittab(bpy_internal_modules);
 
 	bpy_python_start_path(); /* allow to use our own included python */
@@ -264,7 +264,8 @@
 #else
 	(void)argc;
 	(void)argv;
-	
+
+	/* must run before python initializes */
 	PyImport_ExtendInittab(bpy_internal_modules);
 #endif
 




More information about the Bf-blender-cvs mailing list