chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp.c: Factor out and export `mphash'.
[catacomb-python]
/
pgen.c
diff --git
a/pgen.c
b/pgen.c
index 24639ecff96dfa95c11b4e729597b1717522a9c8..30b78ed38f4b6828ea69577082e7c72a5dceb0c2 100644
(file)
--- a/
pgen.c
+++ b/
pgen.c
@@
-120,9
+120,8
@@
static PyObject *pfilt_pyint(PyObject *me)
long l;
PyObject *rc = 0;
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);
}
return (rc);
}
@@
-425,6
+424,7
@@
static int peset_x(PyObject *me, PyObject *xobj, void *hunoz)
mp *x = 0;
pgen_event *ev = PGEVENT_EV(me);
int rc = -1;
mp *x = 0;
pgen_event *ev = PGEVENT_EV(me);
int rc = -1;
+ if (!x) NIERR("__del__");
PGEVENT_CHECK(me);
if ((x = getmp(xobj)) == 0) goto end;
mp_drop(ev->m);
PGEVENT_CHECK(me);
if ((x = getmp(xobj)) == 0) goto end;
mp_drop(ev->m);