summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-04-21 20:18:15 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-04-21 20:41:18 -0700
commitcce74edc6c792efbe402eca681a7cead4836f543 (patch)
tree1b8df60558a598496f190a25c4e735f2359b7aa8 /src
parentda01e9d8442b2aaf0dc69d93ac23b982b3288571 (diff)
downloadpycrypto-cce74edc6c792efbe402eca681a7cead4836f543.tar.gz
AES-NI support: Python 2.1 Backward compatibility
- METH_NOARGS was introduced in Python 2.2. - Python 2.1 doesn't have True and False builtins.
Diffstat (limited to 'src')
-rw-r--r--src/cpuid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpuid.c b/src/cpuid.c
index e4d8b27..5b4b405 100644
--- a/src/cpuid.c
+++ b/src/cpuid.c
@@ -42,6 +42,9 @@ static char have_aes_ni__doc__[] =
static PyObject *
have_aes_ni(PyObject *self, PyObject *args)
{
+ if (!PyArg_ParseTuple(args, ""))
+ return NULL;
+
#ifndef HAVE_CPUID_H
Py_INCREF(Py_False);
return Py_False;
@@ -64,7 +67,7 @@ have_aes_ni(PyObject *self, PyObject *args)
*/
static PyMethodDef cpuid_methods[] = {
- {"have_aes_ni", have_aes_ni, METH_NOARGS, have_aes_ni__doc__},
+ {"have_aes_ni", have_aes_ni, METH_VARARGS, have_aes_ni__doc__},
{NULL, NULL, 0, NULL} /* end-of-list sentinel value */
};