]> granicus.if.org Git - python/commitdiff
Merged revisions 80384 via svnmerge from
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 22 Apr 2010 20:07:28 +0000 (20:07 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 22 Apr 2010 20:07:28 +0000 (20:07 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r80384 | victor.stinner | 2010-04-22 22:01:57 +0200 (jeu., 22 avril 2010) | 2 lines

  Fix my previous commit (r80382) for wide build (unicodeobject.c)
........

Objects/unicodeobject.c

index 4a0746fb73707a36d14d0048ea7bde78177fae07..a9ff3b34c424d6884a0811f94c934c117e3167d5 100644 (file)
@@ -2481,9 +2481,8 @@ PyUnicode_EncodeUTF8(const Py_UNICODE *s,
                 *p++ = (char)(0x80 | ((ch >> 12) & 0x3f));
                 *p++ = (char)(0x80 | ((ch >> 6) & 0x3f));
                 *p++ = (char)(0x80 | (ch & 0x3f));
-
-#endif
             } else {
+#endif
                 Py_ssize_t newpos;
                 PyObject *rep;
                 Py_ssize_t repsize, k;
@@ -2543,7 +2542,9 @@ PyUnicode_EncodeUTF8(const Py_UNICODE *s,
                     }
                 }
                 Py_DECREF(rep);
+#ifndef Py_UNICODE_WIDE
             }
+#endif
         } else if (ch < 0x10000) {
             *p++ = (char)(0xe0 | (ch >> 12));
             *p++ = (char)(0x80 | ((ch >> 6) & 0x3f));