From 7dfda0a3bd00712f58a09bc0c4c50b3699e23e91 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" <stuart@gathman.org> Date: Mon, 24 Dec 2018 18:20:26 -0500 Subject: [PATCH] More #ifdef consolidation. --- MANIFEST.in | 1 - miltermodule.c | 16 ++-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index c9c43e3..dca383e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,7 +10,6 @@ include testmime.py include testutils.py include test.py include sample.py -include sgmllib.py include milter-template.py include test/* include Milter/*.py diff --git a/miltermodule.c b/miltermodule.c index e3d0927..76ab4ee 100644 --- a/miltermodule.c +++ b/miltermodule.c @@ -134,8 +134,10 @@ static struct MilterCallback { #if PY_MAJOR_VERSION >= 3 static struct smfiDesc description; /* forward declaration */ + static PyTypeObject milter_ContextType; #else staticforward struct smfiDesc description; /* forward declaration */ + staticforward PyTypeObject milter_ContextType; #endif static PyObject *MilterError; @@ -148,12 +150,6 @@ typedef struct { static milter_Diag diag; -#if PY_MAJOR_VERSION >= 3 - static PyTypeObject milter_ContextType; -#else - staticforward PyTypeObject milter_ContextType; -#endif - typedef struct { PyObject_HEAD SMFICTX *ctx; /* libmilter thread state */ @@ -772,13 +768,6 @@ milter_wrap_negotiate(SMFICTX *ctx, rc = _generic_wrapper(c, negotiate_callback, arglist); c->t = t; if (rc == SMFIS_CONTINUE) { -#if 0 // PyArgs_Parse deprecated and going away - if (!PyArgs_Parse(optlist,"[kkkk]",pf0,pf1,pf2,pf3)) { - PyErr_Print(); - PyErr_Clear(); /* must clear since not returning to python */ - rc = SMFIS_REJECT; - } -#else unsigned long *pa[4] = { pf0,pf1,pf2,pf3 }; unsigned long fa[4] = { f0,f1,f2,f3 }; int len = PyList_Size(optlist); @@ -797,7 +786,6 @@ milter_wrap_negotiate(SMFICTX *ctx, PyErr_Clear(); rc = SMFIS_REJECT; } -#endif } else if (rc != SMFIS_ALL_OPTS) rc = SMFIS_REJECT; -- GitLab