]> granicus.if.org Git - python/commitdiff
Fix Cygwin compiler issue
authorBob Ippolito <bob@redivi.com>
Thu, 25 May 2006 19:03:19 +0000 (19:03 +0000)
committerBob Ippolito <bob@redivi.com>
Thu, 25 May 2006 19:03:19 +0000 (19:03 +0000)
Modules/_struct.c

index 69ab13f476b3f4f6c05a7d0ff6a6758cac0105fa..ec896bf24dc08cf5a13a3613b721f2eb1482b4a6 100644 (file)
@@ -1416,7 +1416,7 @@ static PyMemberDef s_memberlist[] = {
 
 static
 PyTypeObject PyStructType = {
-       PyObject_HEAD_INIT(&PyType_Type)
+       PyObject_HEAD_INIT(NULL)
        0,
        "Struct",
        sizeof(PyStructObject),
@@ -1467,6 +1467,10 @@ init_struct(void)
        if (m == NULL)
                return;
 
+       PyStructType.ob_type = &PyType_Type;
+       if (PyType_Ready(&PyStructType) < 0)
+               return;
+
        /* Add some symbolic constants to the module */
        if (StructError == NULL) {
                StructError = PyErr_NewException("struct.error", NULL, NULL);