diff options
author | Jason Tishler <jason@tishler.net> | 2003-01-06 12:41:26 (GMT) |
---|---|---|
committer | Jason Tishler <jason@tishler.net> | 2003-01-06 12:41:26 (GMT) |
commit | fb8595df4f9583ab9e83826cd782e0c18ba9cffa (patch) | |
tree | fb178c5308b141f5285fd5b0bb560da02ee8c64c /Modules/bz2module.c | |
parent | f2128b004c5cac7ae8766329b061867de6fb6093 (diff) | |
download | cpython-fb8595df4f9583ab9e83826cd782e0c18ba9cffa.zip cpython-fb8595df4f9583ab9e83826cd782e0c18ba9cffa.tar.gz cpython-fb8595df4f9583ab9e83826cd782e0c18ba9cffa.tar.bz2 |
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.
Diffstat (limited to 'Modules/bz2module.c')
-rw-r--r-- | Modules/bz2module.c | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c index d0383ac..f358de7 100644 --- a/Modules/bz2module.c +++ b/Modules/bz2module.c @@ -1387,8 +1387,8 @@ static PyTypeObject BZ2File_Type = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ + PyObject_GenericGetAttr,/*tp_getattro*/ + PyObject_GenericSetAttr,/*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ BZ2File__doc__, /*tp_doc*/ @@ -1407,9 +1407,9 @@ static PyTypeObject BZ2File_Type = { 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ (initproc)BZ2File_init, /*tp_init*/ - 0, /*tp_alloc*/ + PyType_GenericAlloc, /*tp_alloc*/ 0, /*tp_new*/ - 0, /*tp_free*/ + _PyObject_Del, /*tp_free*/ 0, /*tp_is_gc*/ }; @@ -1652,8 +1652,8 @@ static PyTypeObject BZ2Comp_Type = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ + PyObject_GenericGetAttr,/*tp_getattro*/ + PyObject_GenericSetAttr,/*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ BZ2Comp__doc__, /*tp_doc*/ @@ -1672,9 +1672,9 @@ static PyTypeObject BZ2Comp_Type = { 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ (initproc)BZ2Comp_init, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ + PyType_GenericAlloc, /*tp_alloc*/ + PyType_GenericNew, /*tp_new*/ + _PyObject_Del, /*tp_free*/ 0, /*tp_is_gc*/ }; @@ -1869,8 +1869,8 @@ static PyTypeObject BZ2Decomp_Type = { 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ + PyObject_GenericGetAttr,/*tp_getattro*/ + PyObject_GenericSetAttr,/*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ BZ2Decomp__doc__, /*tp_doc*/ @@ -1889,9 +1889,9 @@ static PyTypeObject BZ2Decomp_Type = { 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ (initproc)BZ2Decomp_init, /*tp_init*/ - 0, /*tp_alloc*/ - 0, /*tp_new*/ - 0, /*tp_free*/ + PyType_GenericAlloc, /*tp_alloc*/ + PyType_GenericNew, /*tp_new*/ + _PyObject_Del, /*tp_free*/ 0, /*tp_is_gc*/ }; @@ -2089,24 +2089,9 @@ initbz2(void) BZ2File_Type.ob_type = &PyType_Type; BZ2File_Type.tp_base = &PyFile_Type; BZ2File_Type.tp_new = PyFile_Type.tp_new; - BZ2File_Type.tp_getattro = PyObject_GenericGetAttr; - BZ2File_Type.tp_setattro = PyObject_GenericSetAttr; - BZ2File_Type.tp_alloc = PyType_GenericAlloc; - BZ2File_Type.tp_free = _PyObject_Del; BZ2Comp_Type.ob_type = &PyType_Type; - BZ2Comp_Type.tp_getattro = PyObject_GenericGetAttr; - BZ2Comp_Type.tp_setattro = PyObject_GenericSetAttr; - BZ2Comp_Type.tp_alloc = PyType_GenericAlloc; - BZ2Comp_Type.tp_new = PyType_GenericNew; - BZ2Comp_Type.tp_free = _PyObject_Del; - BZ2Decomp_Type.ob_type = &PyType_Type; - BZ2Decomp_Type.tp_getattro = PyObject_GenericGetAttr; - BZ2Decomp_Type.tp_setattro = PyObject_GenericSetAttr; - BZ2Decomp_Type.tp_alloc = PyType_GenericAlloc; - BZ2Decomp_Type.tp_new = PyType_GenericNew; - BZ2Decomp_Type.tp_free = _PyObject_Del; m = Py_InitModule3("bz2", bz2_methods, bz2__doc__); |