summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 16:18:21 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 19:14:35 -0700
commit1b309c67633759a5449cbdb38d18f86c861b53c6 (patch)
tree48e2ce91578df286fb3a99e874f1fecbde85ee74 /src
parentea2cf0afd8ccbaa406b107285648e024bc900b64 (diff)
downloadpycrypto-1b309c67633759a5449cbdb38d18f86c861b53c6.tar.gz
Py3k cleanup: METH_O
Diffstat (limited to 'src')
-rw-r--r--src/block_template.c5
-rw-r--r--src/pycrypto_compat.h3
-rw-r--r--src/stream_template.c5
3 files changed, 3 insertions, 10 deletions
diff --git a/src/block_template.c b/src/block_template.c
index f12fbfb..b8a5a17 100644
--- a/src/block_template.c
+++ b/src/block_template.c
@@ -591,13 +591,8 @@ ALG_Decrypt(ALGobject *self, PyObject *args)
/* ALG object methods */
static PyMethodDef ALGmethods[] =
{
-#ifdef IS_PY3K
{"encrypt", (PyCFunction) ALG_Encrypt, METH_O, ALG_Encrypt__doc__},
{"decrypt", (PyCFunction) ALG_Decrypt, METH_O, ALG_Decrypt__doc__},
-#else
- {"encrypt", (PyCFunction) ALG_Encrypt, 0, ALG_Encrypt__doc__},
- {"decrypt", (PyCFunction) ALG_Decrypt, 0, ALG_Decrypt__doc__},
-#endif
{NULL, NULL} /* sentinel */
};
diff --git a/src/pycrypto_compat.h b/src/pycrypto_compat.h
index ccaf21a..c9098d4 100644
--- a/src/pycrypto_compat.h
+++ b/src/pycrypto_compat.h
@@ -45,6 +45,9 @@
# define PyLong_SHIFT SHIFT
# define PyUnicode_FromString PyString_FromString
# endif
+# if PY_MINOR_VERSION <= 1 /* Python 2.1 only */
+# define METH_O METH_OLDARGS /* METH_O is a subset of what METH_OLDARGS provides */
+# endif
#endif
/* Python 2.1 doesn't have PyModule_AddIntConstant */
diff --git a/src/stream_template.c b/src/stream_template.c
index 9c5a99a..1e03f34 100644
--- a/src/stream_template.c
+++ b/src/stream_template.c
@@ -187,13 +187,8 @@ ALG_Decrypt(ALGobject *self, PyObject *args)
/* ALGobject methods */
static PyMethodDef ALGmethods[] =
{
-#ifdef IS_PY3K
{"encrypt", (PyCFunction) ALG_Encrypt, METH_O, ALG_Encrypt__doc__},
{"decrypt", (PyCFunction) ALG_Decrypt, METH_O, ALG_Decrypt__doc__},
-#else
- {"encrypt", (PyCFunction) ALG_Encrypt, 0, ALG_Encrypt__doc__},
- {"decrypt", (PyCFunction) ALG_Decrypt, 0, ALG_Decrypt__doc__},
-#endif
{NULL, NULL} /* sentinel */
};