]> granicus.if.org Git - python/commitdiff
ready _sre types
authorBenjamin Peterson <benjamin@python.org>
Tue, 6 Apr 2010 03:34:09 +0000 (03:34 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 6 Apr 2010 03:34:09 +0000 (03:34 +0000)
Modules/_sre.c

index 2cf97051eb1de2d5ceb8e60dee3c9215df252f69..eda30c465bd17dd3d26f94bbacbd560f5004967d 100644 (file)
@@ -3876,8 +3876,9 @@ PyMODINIT_FUNC init_sre(void)
     PyObject* x;
 
     /* Patch object types */
-    Pattern_Type.ob_type = Match_Type.ob_type =
-        Scanner_Type.ob_type = &PyType_Type;
+    if (PyType_Ready(&Pattern_Type) || PyType_Ready(&Match_Type) ||
+        PyType_Ready(&Scanner_Type))
+        return;
 
     m = Py_InitModule("_" SRE_MODULE, _functions);
     if (m == NULL)