diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 4d2b5dc8e4613f..8a8fc240dd80ba 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -415,6 +415,9 @@ complex_subtype_from_c_complex(PyTypeObject *type, Py_complex cval) { PyObject *op; + if (type == &PyComplex_Type) { + return PyComplex_FromCComplex(cval); + } op = type->tp_alloc(type, 0); if (op != NULL) ((PyComplexObject *)op)->cval = cval;