X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/f3e229044acf6dacc2e3428ac15e4b69772e3e8a..a4cc2ca5f36dfe675fd451606502b2479249463e:/group.c?ds=sidebyside diff --git a/group.c b/group.c index 8774290..1e93ccc 100644 --- a/group.c +++ b/group.c @@ -589,7 +589,10 @@ static PyObject *ge_pyexp(PyObject *x, PyObject *n, PyObject *m) mp *nn; ge *z; - if (m != Py_None || !GE_PYCHECK(x) || (nn = implicitmp(n)) == 0) + if (m != Py_None || !GE_PYCHECK(x)) RETURN_NOTIMPL; + if (FE_PYCHECK(n) && FE_F(n)->ops->ty == FTY_PRIME) + nn = F_OUT(FE_F(n), MP_NEW, FE_X(n)); + else if ((nn = implicitmp(n)) == 0) RETURN_NOTIMPL; z = G_CREATE(GE_G(x)); G_EXP(GE_G(x), z, GE_X(x), nn);