X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/5ec4e0d8db70dd19d6c294092c71e608d2888bb5..a3ae4a9f590ef84d8e6eac0bc94873a9fd943073:/pgen.c diff --git a/pgen.c b/pgen.c index 24639ec..108fa31 100644 --- 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); }