summaryrefslogtreecommitdiff
path: root/Modules/_sre.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 68d511e2f8..6f1e2b62f7 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -3363,19 +3363,19 @@ static PyMethodDef _functions[] = {
{NULL, NULL}
};
-#if PY_VERSION_HEX < 0x02030000
-DL_EXPORT(void) init_sre(void)
-#else
PyMODINIT_FUNC init_sre(void)
-#endif
{
PyObject* m;
PyObject* d;
PyObject* x;
- /* Patch object types */
- Pattern_Type.ob_type = Match_Type.ob_type =
- Scanner_Type.ob_type = &PyType_Type;
+ /* Initialize object types */
+ if (PyType_Ready(&Pattern_Type) < 0)
+ return;
+ if (PyType_Ready(&Match_Type) < 0)
+ return;
+ if (PyType_Ready(&Scanner_Type) < 0)
+ return;
m = Py_InitModule("_" SRE_MODULE, _functions);
if (m == NULL)