Issue #24731: Fixed crash on converting objects with special methods
__str__, __trunc__, and __float__ returning instances of subclasses of
str, long, and float to subclasses of str, long, and float correspondingly.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index c1e12a7..14c5177 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3719,7 +3719,7 @@
     tmp = string_new(&PyString_Type, args, kwds);
     if (tmp == NULL)
         return NULL;
-    assert(PyString_CheckExact(tmp));
+    assert(PyString_Check(tmp));
     n = PyString_GET_SIZE(tmp);
     pnew = type->tp_alloc(type, n);
     if (pnew != NULL) {