summaryrefslogtreecommitdiffstats
path: root/Modules/syslogmodule.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-01-17 00:01:33 (GMT)
committerBarry Warsaw <barry@python.org>1997-01-17 00:01:33 (GMT)
commite886ea916ec1a4a5c3f4247ea5978b626620cf67 (patch)
tree3e16a3b7af64b70c3d91dccf25ff742e76306e32 /Modules/syslogmodule.c
parentbb779ec4d92b89c39ce0ea752c1ba3f26c80c0ea (diff)
downloadcpython-e886ea916ec1a4a5c3f4247ea5978b626620cf67.zip
cpython-e886ea916ec1a4a5c3f4247ea5978b626620cf67.tar.gz
cpython-e886ea916ec1a4a5c3f4247ea5978b626620cf67.tar.bz2
(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.
Diffstat (limited to 'Modules/syslogmodule.c')
-rw-r--r--Modules/syslogmodule.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index db27101..daee15f 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);
+ }
}