chiark / gitweb /
bytestring.c: Check for cached hash more carefully.
[catacomb-python] / bytestring.c
index b78ec1451510ffb35febc757771db4d309cde63e..7dcc4065238ffbc14c7d532afa8b76be5c5520c0 100644 (file)
@@ -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;