[Python-checkins] cpython (3.1): fix build without Py_DEBUG and DNDEBUG (closes #14509)

benjamin.peterson python-checkins at python.org
Mon Apr 9 21:06:04 CEST 2012


http://hg.python.org/cpython/rev/64bb1d258322
changeset:   76191:64bb1d258322
branch:      3.1
parent:      76142:f1876c0a630a
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Apr 09 14:53:07 2012 -0400
summary:
  fix build without Py_DEBUG and DNDEBUG (closes #14509)

files:
  Objects/bytesobject.c   |  2 ++
  Objects/unicodeobject.c |  2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -896,7 +896,9 @@
     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
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -7341,7 +7341,9 @@
     Py_UNICODE *p;
     long x;
 
+#ifdef Py_DEBUG
     assert(_Py_HashSecret_Initialized);
+#endif
     if (self->hash != -1)
         return self->hash;
     len = Py_SIZE(self);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list