]> granicus.if.org Git - python/commitdiff
Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
authorChristian Heimes <christian@cheimes.de>
Thu, 3 Jan 2013 08:21:55 +0000 (09:21 +0100)
committerChristian Heimes <christian@cheimes.de>
Thu, 3 Jan 2013 08:21:55 +0000 (09:21 +0100)
non-pydebug builds. Several extension modules now compile cleanly when
assert()s are enabled in standard builds (-DDEBUG flag).

Misc/NEWS
Modules/_json.c
Modules/md5module.c
Modules/sha1module.c
Modules/sha256module.c
Modules/sha512module.c

index e4fd504eb3eff282d47c47f2f12db37a1f85a8ef..41126a6e436d5376fdd27ac90cb6b3d128ee23ce 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -4293,6 +4293,10 @@ Tools/Demos
 Extension Modules
 -----------------
 
+- Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
+  non-pydebug builds. Several extension modules now compile cleanly when
+  assert()s are enabled in standard builds (-DDEBUG flag).
+
 - Issue #13840: The error message produced by ctypes.create_string_buffer
   when given a Unicode string has been fixed.
 
index 5b42f6f7186219a34eed2599c05b86f284de04a2..db45c28fe4033fd875b53675bd3531b17439faa9 100644 (file)
@@ -246,7 +246,9 @@ ascii_escape_unicode(PyObject *pystr)
         }
     }
     output[chars++] = '"';
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(rval, 1));
+#endif
     return rval;
 }
 
index e2681a8ae5a5222dd02ea2747ca56664d26cfc20..12e187cb9402749645aba8e1a675d485a0afa619 100644 (file)
@@ -399,7 +399,9 @@ MD5_hexdigest(MD5object *self, PyObject *unused)
         c = (digest[i] & 0xf);
         hex_digest[j++] = Py_hexdigits[c];
     }
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(retval, 1));
+#endif
     return retval;
 }
 
index a733c4b5bb1720690a4572901961566f5558e65f..09b87ef25022c15c022cedeb5044a2f360a39a58 100644 (file)
@@ -376,7 +376,9 @@ SHA1_hexdigest(SHA1object *self, PyObject *unused)
         c = (digest[i] & 0xf);
         hex_digest[j++] = Py_hexdigits[c];
     }
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(retval, 1));
+#endif
     return retval;
 }
 
index 76d91afda37aaea229b66833845bccf9166446ad..9f6b41639c1ee1f8d42de2b94808f34cdb647541 100644 (file)
@@ -466,7 +466,9 @@ SHA256_hexdigest(SHAobject *self, PyObject *unused)
         c = (digest[i] & 0xf);
         hex_digest[j++] = Py_hexdigits[c];
     }
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(retval, 1));
+#endif
     return retval;
 }
 
index 88f8a64d0624d302d75ed98b3a5830624145129f..5536fd5c1c8e438289031d947585c0f7de5ed066 100644 (file)
@@ -532,7 +532,9 @@ SHA512_hexdigest(SHAobject *self, PyObject *unused)
         c = (digest[i] & 0xf);
         hex_digest[j++] = Py_hexdigits[c];
     }
+#ifdef Py_DEBUG
     assert(_PyUnicode_CheckConsistency(retval, 1));
+#endif
     return retval;
 }