Issue #24731: Fixed crash on converting objects with special methods
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 7036c0e..3a64b53 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -4405,7 +4405,7 @@
tmp = (PyLongObject *)long_new(&PyLong_Type, args, kwds);
if (tmp == NULL)
return NULL;
- assert(PyLong_CheckExact(tmp));
+ assert(PyLong_Check(tmp));
n = Py_SIZE(tmp);
if (n < 0)
n = -n;