[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42064] trunk/blender/source/blender/ python/generic/py_capi_utils.c: fix [#29319] bus error with python with link_append and {}

Campbell Barton ideasman42 at gmail.com
Tue Nov 22 15:05:09 CET 2011


Revision: 42064
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42064
Author:   campbellbarton
Date:     2011-11-22 14:05:08 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
fix [#29319] bus error with python with link_append and {}
patch from Emil Brink

Modified Paths:
--------------
    trunk/blender/source/blender/python/generic/py_capi_utils.c

Modified: trunk/blender/source/blender/python/generic/py_capi_utils.c
===================================================================
--- trunk/blender/source/blender/python/generic/py_capi_utils.c	2011-11-22 14:04:34 UTC (rev 42063)
+++ trunk/blender/source/blender/python/generic/py_capi_utils.c	2011-11-22 14:05:08 UTC (rev 42064)
@@ -385,8 +385,12 @@
 		if (PyBytes_Check(py_str)) {
 			return PyBytes_AS_STRING(py_str);
 		}
+		else if ((*coerce= PyUnicode_EncodeFSDefault(py_str))) {
+			return PyBytes_AS_STRING(*coerce);
+		}
 		else {
-			return PyBytes_AS_STRING((*coerce= PyUnicode_EncodeFSDefault(py_str)));
+			/* leave error raised from EncodeFS */
+			return NULL;
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list