]> granicus.if.org Git - python/commitdiff
Fixes to compile cPickle.c & socketmodule.c on cygwin and possibly
authorMichael W. Hudson <mwh@python.net>
Fri, 9 Nov 2001 10:06:23 +0000 (10:06 +0000)
committerMichael W. Hudson <mwh@python.net>
Fri, 9 Nov 2001 10:06:23 +0000 (10:06 +0000)
other platforms that have funny ideas about whether addresses of
functions in dlls are compile-time constants.

Modules/cPickle.c
Modules/socketmodule.c

index b2392f9996e68728f1ed047e2b672cf555858089..f8a3c1c0f61f9dff8405c6327f2d9784b2e9756f 100644 (file)
@@ -2494,8 +2494,8 @@ static PyTypeObject Picklertype = {
     0,                                 /* tp_hash */
     0,                                 /* tp_call */
     0,                                 /* tp_str */
-    PyObject_GenericGetAttr,           /* tp_getattro */
-    PyObject_GenericSetAttr,           /* tp_setattro */
+    0, /* set below */                 /* tp_getattro */
+    0, /* set below */                 /* tp_setattro */
     0,                                 /* tp_as_buffer */
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
     Picklertype__doc__,                        /* tp_doc */
@@ -4668,6 +4668,8 @@ initcPickle(void) {
     PyObject *compatible_formats;
 
     Picklertype.ob_type = &PyType_Type;
+    Picklertype.tp_getattro = PyObject_GenericGetAttr;
+    Picklertype.tp_setattro = PyObject_GenericSetAttr;
     Unpicklertype.ob_type = &PyType_Type;
     PdataType.ob_type = &PyType_Type;
 
index 601880e56540b35fae0b24128f44d461cc1019e7..2a62f5d1dceee6e89e0e7b4dc8b92017e9f813da 100644 (file)
@@ -1877,7 +1877,7 @@ static PyTypeObject PySocketSock_Type = {
        0,                                      /* tp_hash */
        0,                                      /* tp_call */
        0,                                      /* tp_str */
-       PyObject_GenericGetAttr,                /* tp_getattro */
+       0,      /* set below */                 /* tp_getattro */
        0,                                      /* tp_setattro */
        0,                                      /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
@@ -1897,9 +1897,9 @@ static PyTypeObject PySocketSock_Type = {
        0,                                      /* tp_descr_set */
        0,                                      /* tp_dictoffset */
        PySocketSock_init,                      /* tp_init */
-       PyType_GenericAlloc,                    /* tp_alloc */
+       0,      /* set below */                 /* tp_alloc */
        PySocketSock_new,                       /* tp_new */
-       _PyObject_Del,                          /* tp_free */
+       0,      /* set below */                 /* tp_free */
 };
 
 
@@ -3133,6 +3133,9 @@ init_socket(void)
 #endif /* MS_WINDOWS */
 #endif /* RISCOS */
        PySocketSock_Type.ob_type = &PyType_Type;
+       PySocketSock_Type.tp_getattro = PyObject_GenericGetAttr;
+       PySocketSock_Type.tp_alloc = PyType_GenericAlloc;
+       PySocketSock_Type.tp_free = _PyObject_Del;
 #ifdef USE_SSL
        PySSL_Type.ob_type = &PyType_Type;
 #endif