chiark / gitweb /
pubkey.c, ...: Support Bernstein's `Ed25519' signature scheme.
[catacomb-python] / group.c
diff --git a/group.c b/group.c
index 1432fc86e204c49ffa17ad8d57659d0dcafe1869..71d339e1f49069390a009fd842704daa5382657f 100644 (file)
--- a/group.c
+++ b/group.c
@@ -695,8 +695,8 @@ static PyObject *ge_pyint(PyObject *me)
 
   if ((x = G_TOINT(GE_G(me), MP_NEW, GE_X(me))) == 0)
     TYERR("can't convert to integer");
-  if (mp_tolong_checked(x, &l)) goto end;
-  rc = PyInt_FromLong(l);
+  if (!mp_tolong_checked(x, &l, 0)) rc = PyInt_FromLong(l);
+  else rc = mp_topylong(x);
 end:
   mp_drop(x);
   return (rc);