From: Benjamin Peterson Date: Mon, 9 Apr 2012 18:53:07 +0000 (-0400) Subject: fix build without Py_DEBUG and DNDEBUG (closes #14509) X-Git-Tag: 3.1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6622c8a3e6bdf92778359417d0fa6c3e6bda909;p=thirdparty%2FPython%2Fcpython.git fix build without Py_DEBUG and DNDEBUG (closes #14509) --- diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index db93f37bacc4..a0c121ededf5 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -896,7 +896,9 @@ bytes_hash(PyBytesObject *a) register unsigned char *p; register long x; +#ifdef Py_DEBUG assert(_Py_HashSecret_Initialized); +#endif if (a->ob_shash != -1) return a->ob_shash; len = Py_SIZE(a); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 2ec878f916a8..341114f9431b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -7341,7 +7341,9 @@ unicode_hash(PyUnicodeObject *self) Py_UNICODE *p; long x; +#ifdef Py_DEBUG assert(_Py_HashSecret_Initialized); +#endif if (self->hash != -1) return self->hash; len = Py_SIZE(self);