chiark / gitweb /
Use ValueError instead of SyntaxError throughout.
[catacomb-python] / group.c
diff --git a/group.c b/group.c
index 0fc8eb2b228886e7d65278d0a7829a443bc618cb..5cc40e54a364cecb0028ca35329e9afc5fb0c792 100644 (file)
--- a/group.c
+++ b/group.c
@@ -264,7 +264,7 @@ static PyObject *meth__parse(PyObject *me, PyObject *arg, PyTypeObject *ty,
   if (!PyArg_ParseTuple(arg, "Os:parse", &me, &p)) goto end;
   qd.p = p;
   qd.e = 0;
-  if (parse(&qd, &gp)) SYNERR(qd.e);
+  if (parse(&qd, &gp)) VALERR(qd.e);
   rc = fginfo_pywrap(&gp, ty);
 end:
   return (rc);
@@ -517,7 +517,7 @@ static PyObject *ge_pynew(PyTypeObject *ty, PyObject *arg, PyObject *kw)
     sc.buf = PyString_AS_STRING(x);
     sc.lim = sc.buf + PyString_GET_SIZE(x);
     if (G_READ(g, xx, &mptext_stringops, &sc) || sc.buf < sc.lim)
-      SYNERR("malformed group element string");
+      VALERR("malformed group element string");
   } else
     TYERR("can't convert to group element");
   return (ge_pywrap((PyObject *)ty, xx));
@@ -868,7 +868,7 @@ static PyObject *meth__GE_fromstring(PyObject *me, PyObject *arg)
   g = GROUP_G(me);
   x = G_CREATE(g);
   if (G_READ(g, x, &mptext_stringops, &sc))
-    SYNERR("bad group element string");
+    VALERR("bad group element string");
   return (Py_BuildValue("(Ns#)", ge_pywrap(me, x),
                        sc.buf, (int)(sc.lim - sc.buf)));
 end:
@@ -887,7 +887,7 @@ static PyObject *meth__Group_parse(PyObject *me, PyObject *arg)
   qd.p = p;
   qd.e = 0;
   if ((g = group_parse(&qd)) == 0)
-    SYNERR(qd.e);
+    VALERR(qd.e);
   return (group_pywrap(g));
 end:
   return (0);