summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2006-04-04 15:05:23 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2006-04-04 15:05:23 (GMT)
commit3b8ff310554294b1aa9ba5c9f551e2e941d8d7fa (patch)
tree00bc6b9f30a2577d6dc7f4487bfe87870d1c44b4 /Modules
parentcbb9f972994ae1d28d052f8406c5cb530a64de56 (diff)
downloadcpython-3b8ff310554294b1aa9ba5c9f551e2e941d8d7fa.zip
cpython-3b8ff310554294b1aa9ba5c9f551e2e941d8d7fa.tar.gz
cpython-3b8ff310554294b1aa9ba5c9f551e2e941d8d7fa.tar.bz2
SF Bug #1448488 - make collectionsmodule build on Cygwin, using the same
techniques as in Modules/xxsubtype.c
Diffstat (limited to 'Modules')
-rw-r--r--Modules/collectionsmodule.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/collectionsmodule.c b/Modules/collectionsmodule.c
index 61473e1..5bccc7c 100644
--- a/Modules/collectionsmodule.c
+++ b/Modules/collectionsmodule.c
@@ -1277,8 +1277,11 @@ a new value when a key is not present, in __getitem__ only.\n\
A defaultdict compares equal to a dict with the same items.\n\
");
+/* See comment in xxsubtype.c */
+#define DEFERRED_ADDRESS(ADDR) 0
+
static PyTypeObject defdict_type = {
- PyObject_HEAD_INIT(NULL)
+ PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type))
0, /* ob_size */
"collections.defaultdict", /* tp_name */
sizeof(defdictobject), /* tp_basicsize */
@@ -1311,7 +1314,7 @@ static PyTypeObject defdict_type = {
defdict_methods, /* tp_methods */
defdict_members, /* tp_members */
0, /* tp_getset */
- &PyDict_Type, /* tp_base */
+ DEFERRED_ADDRESS(&PyDict_Type), /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
@@ -1344,6 +1347,7 @@ initcollections(void)
Py_INCREF(&deque_type);
PyModule_AddObject(m, "deque", (PyObject *)&deque_type);
+ defdict_type.tp_base = &PyDict_Type;
if (PyType_Ready(&defdict_type) < 0)
return;
Py_INCREF(&defdict_type);