From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: bytestring.c: Check for cached hash more carefully. X-Git-Tag: 1.2.0~44 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/69e137681fb60aa4acc6d9fd5b56b7adeba0b625 bytestring.c: Check for cached hash more carefully. The `CACHE_HASH' symbol has been missing for years because the feature is always on nowadays. Amazingly, I never noticed. --- diff --git a/bytestring.c b/bytestring.c index b78ec14..7dcc406 100644 --- a/bytestring.c +++ b/bytestring.c @@ -37,7 +37,7 @@ static PyObject *dowrap(PyTypeObject *ty, const void *p, size_t n) PyStringObject *x = (PyStringObject *)ty->tp_alloc(ty, n); if (p) memcpy(x->ob_sval, p, n); x->ob_sval[n] = 0; -#ifdef CACHE_HASH +#if defined(CACHE_HASH) || PY_VERSION_HEX >= 0x02030000 x->ob_shash = -1; #endif x->ob_sstate = SSTATE_NOT_INTERNED;