- if (!PyType_Check(cty) || !PyType_IsSubtype(cty, ecpt_pytype))
- TYERR("want subtype of catacomb.ECPt");
- if (G_TOEC(GE_G(me), &p, GE_X(me)))
+ g = GROUP_G(GE_GOBJ(me));
+ if (cty) {
+ if (!PyType_Check(cty) || !PyType_IsSubtype(cty, ecpt_pytype))
+ TYERR("want subtype of catacomb.ECPt");
+ Py_INCREF((PyObject *)cty);
+ } else if (strcmp(G_NAME(g), "ec") == 0) {
+ c = eccurve_copy(((gctx_ec *)g)->ei.c);
+ cty = (PyTypeObject *)eccurve_pywrap(0, c);
+ } else {
+ cty = ecpt_pytype;
+ Py_INCREF((PyObject *)cty);
+ }
+ if (G_TOEC(GE_G(me), &p, GE_X(me))) {
+ Py_DECREF((PyObject *)cty);