From fb8595df4f9583ab9e83826cd782e0c18ba9cffa Mon Sep 17 00:00:00 2001 From: Jason Tishler Date: Mon, 6 Jan 2003 12:41:26 +0000 Subject: Patch #661760: Cygwin auto-import module patch The attached patch enables shared extension modules to build cleanly under Cygwin without moving the static initialization of certain function pointers (i.e., ones exported from the Python DLL core) to a module initialization function. Additionally, this patch fixes the modules that have been changed in the past to accommodate Cygwin. --- Modules/_randommodule.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Modules/_randommodule.c') diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 1b96dc8c35..35f10a5d36 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -486,7 +486,7 @@ static PyTypeObject Random_Type = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - 0, /*tp_getattro*/ + PyObject_GenericGetAttr, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ @@ -506,9 +506,9 @@ static PyTypeObject Random_Type = { 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ - 0, /*tp_alloc*/ + PyType_GenericAlloc, /*tp_alloc*/ random_new, /*tp_new*/ - 0, /*tp_free*/ + _PyObject_Del, /*tp_free*/ 0, /*tp_is_gc*/ }; @@ -520,9 +520,6 @@ init_random(void) { PyObject *m; - Random_Type.tp_getattro = PyObject_GenericGetAttr; - Random_Type.tp_alloc = PyType_GenericAlloc; - Random_Type.tp_free = _PyObject_Del; if (PyType_Ready(&Random_Type) < 0) return; m = Py_InitModule3("_random", NULL, module_doc); -- cgit v1.2.1