chiark / gitweb /
Use ValueError instead of SyntaxError throughout.
[catacomb-python] / mp.c
diff --git a/mp.c b/mp.c
index cb63a4f653dfa98a8f337735e90b15fd820359d3..2434eaf75f1147e54cfb25be55ac5a05066075d7 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -921,7 +921,7 @@ static PyObject *meth__MP_fromstring(PyObject *me,
   if (!good_radix_p(r, 1)) VALERR("bad radix");
   sc.buf = p; sc.lim = p + len;
   if ((zz = mp_read(MP_NEW, r, &mptext_stringops, &sc)) == 0)
-    SYNERR("bad integer");
+    VALERR("bad integer");
   z = Py_BuildValue("(Ns#)", mp_pywrap(zz), sc.buf, (int)(sc.lim - sc.buf));
 end:
   return (z);
@@ -2123,7 +2123,7 @@ static PyObject *meth__GF_fromstring(PyObject *me,
   if ((zz = mp_read(MP_NEW, r, &mptext_stringops, &sc)) == 0 ||
       MP_NEGP(zz)) {
     if (zz) MP_DROP(zz);
-    SYNERR("bad binary polynomial");
+    VALERR("bad binary polynomial");
   }
   z = Py_BuildValue("(Ns#)", gf_pywrap(zz), sc.buf, (int)(sc.lim - sc.buf));
 end: