Commit 212a3906 by Victor M. Alvarez

Fix issue with hash functions in Python 3.2+

Starting with Python 3.2 hash functions should return Py_hash_t instead of long.
parent 104e95bf
......@@ -39,6 +39,10 @@ typedef int Py_ssize_t;
#define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
#endif
#if PY_VERSION_HEX < 0x03020000
typedef long Py_hash_t
#endif
#if PY_MAJOR_VERSION >= 3
#define PY_STRING(x) PyUnicode_FromString(x)
#define PY_STRING_TO_C(x) PyBytes_AsString(\
......@@ -139,7 +143,7 @@ static PyObject* Match_richcompare(
PyObject* other,
int op);
static long Match_hash(
static Py_hash_t Match_hash(
PyObject* self);
......@@ -951,7 +955,7 @@ static PyObject* Match_richcompare(
}
static long Match_hash(
static Py_hash_t Match_hash(
PyObject* self)
{
Match* match = (Match*) self;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment