ready _sre types
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 2cf9705..eda30c4 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -3876,8 +3876,9 @@
     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)