diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-23 19:54:28 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-23 19:54:28 (GMT) |
commit | 9227508dec49240d3e528d0a319048a3a2cb02c6 (patch) | |
tree | 0e196f7403b4ce9167baf0b4de7242e66995b329 /Modules | |
parent | f67ea2d0050c45e7ee7120bf1c5ecee622feffcc (diff) | |
download | cpython-9227508dec49240d3e528d0a319048a3a2cb02c6.zip cpython-9227508dec49240d3e528d0a319048a3a2cb02c6.tar.gz cpython-9227508dec49240d3e528d0a319048a3a2cb02c6.tar.bz2 |
Merged revisions 84980 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84980 | antoine.pitrou | 2010-09-23 21:51:39 +0200 (jeu., 23 sept. 2010) | 3 lines
Issue #9928: Properly initialize the types exported by the bz2 module.
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/bz2module.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c index 215fa4b..f418969 100644 --- a/Modules/bz2module.c +++ b/Modules/bz2module.c @@ -2158,9 +2158,12 @@ PyInit_bz2(void) { PyObject *m; - Py_TYPE(&BZ2File_Type) = &PyType_Type; - Py_TYPE(&BZ2Comp_Type) = &PyType_Type; - Py_TYPE(&BZ2Decomp_Type) = &PyType_Type; + if (PyType_Ready(&BZ2File_Type) < 0) + return NULL; + if (PyType_Ready(&BZ2Comp_Type) < 0) + return NULL; + if (PyType_Ready(&BZ2Decomp_Type) < 0) + return NULL; m = PyModule_Create(&bz2module); if (m == NULL) |