summaryrefslogtreecommitdiff
path: root/Modules/bz2module.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-23 19:55:24 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-23 19:55:24 +0000
commit2c7d6859a42634921b2bb2447dfa890633db4d05 (patch)
treee781f0cd543e14ee0fbb493a5c6ce98277e75e76 /Modules/bz2module.c
parentfa647ec409f586cbc313e9489e9c3c48e31c7f7d (diff)
downloadcpython-git-2c7d6859a42634921b2bb2447dfa890633db4d05.tar.gz
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/bz2module.c')
-rw-r--r--Modules/bz2module.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 0a367a7769..de2e20bbf7 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -2320,9 +2320,12 @@ initbz2(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;
+ if (PyType_Ready(&BZ2Comp_Type) < 0)
+ return;
+ if (PyType_Ready(&BZ2Decomp_Type) < 0)
+ return;
m = Py_InitModule3("bz2", bz2_methods, bz2__doc__);
if (m == NULL)