fix for building on some configurations.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Mar 2011 01:48:01 +0000 (01:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Mar 2011 01:48:01 +0000 (01:48 +0000)
source/blender/python/intern/bpy_library.c

index 9bd5cded038cf4db9e390f11f679395693eaacaf..d216c449250bd2ce3d1958f068b4541fa89f8b46 100644 (file)
@@ -102,7 +102,7 @@ PyTypeObject bpy_lib_Type = {
        NULL,                       /* reprfunc tp_str; */
 
        /* will only use these if this is a subtype of a py class */
-       PyObject_GenericGetAttr,        /* getattrofunc tp_getattro; */
+       NULL /*PyObject_GenericGetAttr is assigned later */,    /* getattrofunc tp_getattro; */
        NULL,                                           /* setattrofunc tp_setattro; */
 
        /* Functions to access object as input/output buffer */
@@ -357,6 +357,9 @@ int bpy_lib_init(PyObject *mod_par)
        static PyMethodDef load_meth= {"load", (PyCFunction)bpy_lib_load, METH_STATIC|METH_VARARGS|METH_KEYWORDS, bpy_lib_load_doc};
        PyModule_AddObject(mod_par, "_library_load", PyCFunction_New(&load_meth, NULL));
 
+       /* some compilers dont like accessing this directly, delay assignment */
+       bpy_lib_Type.tp_getattro= PyObject_GenericGetAttr;
+
        if(PyType_Ready(&bpy_lib_Type) < 0)
                return -1;