chiark / gitweb /
debian/: Use `dh_python2' for packaging.
[catacomb-python] / pgen.c
diff --git a/pgen.c b/pgen.c
index 24639ecff96dfa95c11b4e729597b1717522a9c8..8b5f6b23e10d2212ab6273a28bbf4c43acb925a7 100644 (file)
--- a/pgen.c
+++ b/pgen.c
@@ -120,9 +120,8 @@ static PyObject *pfilt_pyint(PyObject *me)
   long l;
   PyObject *rc = 0;
 
-  if (mp_tolong_checked(PFILT_F(me)->m, &l)) goto end;
-  rc = PyInt_FromLong(l);
-end:
+  if (!mp_tolong_checked(PFILT_F(me)->m, &l, 0)) rc = PyInt_FromLong(l);
+  else rc = mp_topylong(PFILT_F(me)->m);
   return (rc);
 }
 
@@ -220,7 +219,7 @@ static PyTypeObject pfilt_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Small-primes filter.",
+"PrimeFilter(X): small-primes filter.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -353,7 +352,7 @@ static PyTypeObject rabin_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Rabin-Miller strong primality test.",
+"RabinMiller(X): Rabin-Miller strong primality test.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -726,7 +725,7 @@ static PyTypeObject pgstep_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-  "Simple prime-number stepper with small-factors filter.",
+"PrimeGenStepper(STEP): simple stepper with small-factors filter.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -808,7 +807,7 @@ static PyTypeObject pgjump_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Stepper for larger steps, with small-factors filter.",
+"PrimeGenJumper(JUMP): stepper for larger steps with small-factors filter.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */
@@ -869,7 +868,7 @@ static PyTypeObject pgtest_pytype_skel = {
     Py_TPFLAGS_BASETYPE,
 
   /* @tp_doc@ */
-"Rabin-Miller tester.",
+"PrimeGenTester(): Rabin-Miller tester.",
 
   0,                                   /* @tp_traverse@ */
   0,                                   /* @tp_clear@ */