From: Georg Brandl <georg@python.org>
Date: Sun, 1 Aug 2010 20:51:02 +0000 (+0000)
Subject: Revert r83395, it introduces test failures and is not necessary anyway since we now... 
X-Git-Tag: v3.2a2~556
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78eef3de8888ce3ec19529a7d780ad8281e672ea;p=python

Revert r83395, it introduces test failures and is not necessary anyway since we now have to nul-terminate the string anyway.
---

diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index bfd19ebbbf..f2d666de12 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3734,7 +3734,7 @@ PyObject *PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s,
 
             ch2 = *s++;
             size--;
-            if (ch2 >= 0xDC00 && ch2 <= 0xDFFF && size) {
+            if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {
                 ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000;
                 *p++ = '\\';
                 *p++ = 'U';
@@ -3976,7 +3976,7 @@ PyObject *PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s,
 
                 ch2 = *s++;
                 size--;
-                if (ch2 >= 0xDC00 && ch2 <= 0xDFFF && size) {
+                if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) {
                     ucs = (((ch & 0x03FF) << 10) | (ch2 & 0x03FF)) + 0x00010000;
                     *p++ = '\\';
                     *p++ = 'U';