From 42d30ef60edcafe5b5f85f8c0e7d7637ed0a84fc Mon Sep 17 00:00:00 2001 Message-Id: <42d30ef60edcafe5b5f85f8c0e7d7637ed0a84fc.1716261224.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] bytestring.c: Check for cached hash more carefully. Organization: Straylight/Edgeware From: Mark Wooding The `CACHE_HASH' symbol has been missing for years because the feature is always on nowadays. Amazingly, I never noticed. --- bytestring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bytestring.c b/bytestring.c index b3b32de..4a7378d 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; -- [mdw]