summaryrefslogtreecommitdiff
path: root/src/stream_template.c
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 16:02:04 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 19:13:33 -0700
commit5c0ec3238a2b8f69be75040c706959e5c852f5ad (patch)
tree53d561098fb3d75af643333a0302e32fafd33d9c /src/stream_template.c
parent1418e318180f651de1c4b08468b75ca719d703ba (diff)
downloadpycrypto-5c0ec3238a2b8f69be75040c706959e5c852f5ad.tar.gz
Py3k cleanup: Define PyInt_FromLong for Python 3.x and use it
This is the first of a series of changes that aims to reduce code duplication between the Python 3 and Python 2 versions of the C extensions.
Diffstat (limited to 'src/stream_template.c')
-rw-r--r--src/stream_template.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/stream_template.c b/src/stream_template.c
index da7baa6..5d13650 100644
--- a/src/stream_template.c
+++ b/src/stream_template.c
@@ -59,7 +59,6 @@ static PyTypeObject ALGtype;
#else
staticforward PyTypeObject ALGtype;
#define is_ALGobject(v) ((v)->ob_type == &ALGtype)
-#define PyLong_FromLong PyInt_FromLong /* For Python 2.x */
#endif
static ALGobject *
@@ -216,7 +215,7 @@ ALGgetattr(PyObject *self, char *name)
if (strcmp(name, "block_size") == 0)
#endif
{
- return PyLong_FromLong(BLOCK_SIZE);
+ return PyInt_FromLong(BLOCK_SIZE);
}
#ifdef IS_PY3K
if (PyUnicode_CompareWithASCIIString(attr, "key_size") == 0)
@@ -224,7 +223,7 @@ ALGgetattr(PyObject *self, char *name)
if (strcmp(name, "key_size") == 0)
#endif
{
- return PyLong_FromLong(KEY_SIZE);
+ return PyInt_FromLong(KEY_SIZE);
}
#ifdef IS_PY3K
generic: