From e886ea916ec1a4a5c3f4247ea5978b626620cf67 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Fri, 17 Jan 1997 00:01:33 +0000 Subject: (puremodule.c): New module which exports the Purify and Quantify C API to Python. Minimal documentation is included in comments at the top of the file, and in the Misc/PURIFY.README file. Note that this module must be statically linked since Pure doesn't provide shared stubs libraries. (Setup.in): Added commented template for pure module (syslogmodule.c): ins() function wasn't declared static. --- Modules/syslogmodule.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Modules/syslogmodule.c') diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index db271011ac..daee15f1fb 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -155,14 +155,17 @@ static PyMethodDef syslog_methods[] = { /* Initialization function for the module */ -void ins(d, s, x) +static void +ins(d, s, x) PyObject *d; char *s; long x; { - PyObject *xl = PyInt_FromLong(x); - PyDict_SetItemString(d, s, xl); - Py_XDECREF(xl); + PyObject *v = PyInt_FromLong(x); + if (v) { + PyDict_SetItemString(d, s, v); + Py_DECREF(v); + } } -- cgit v1.2.1