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

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


http://hg.python.org/cpython/rev/a11a2bbd8241
changeset:   76189:a11a2bbd8241
branch:      2.7
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/stringobject.c  |  2 ++
  Objects/unicodeobject.c |  2 ++
  2 files changed, 4 insertions(+), 0 deletions(-)


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

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


More information about the Python-checkins mailing list