Author: christian.heimes
Date: Sat Nov  3 18:34:18 2007
New Revision: 58830

Modified:
   python/branches/py3k-pep3137/Objects/unicodeobject.c
Log:
Fixed PyUnicode_*MBCS* functions. They still returned a PyBytes instance 
instead of PyString.

Modified: python/branches/py3k-pep3137/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-pep3137/Objects/unicodeobject.c        (original)
+++ python/branches/py3k-pep3137/Objects/unicodeobject.c        Sat Nov  3 
18:34:18 2007
@@ -3835,20 +3835,20 @@
 
     if (*repr == NULL) {
        /* Create string object */
-       *repr = PyBytes_FromStringAndSize(NULL, mbcssize);
+       *repr = PyString_FromStringAndSize(NULL, mbcssize);
        if (*repr == NULL)
            return -1;
     }
     else {
        /* Extend string object */
-       n = PyBytes_Size(*repr);
-       if (PyBytes_Resize(*repr, n + mbcssize) < 0)
+       n = PyString_Size(*repr);
+       if (_PyString_Resize(repr, n + mbcssize) < 0)
            return -1;
     }
 
     /* Do the conversion */
     if (size > 0) {
-       char *s = PyBytes_AS_STRING(*repr) + n;
+       char *s = PyString_AS_STRING(*repr) + n;
        if (0 == WideCharToMultiByte(CP_ACP, 0, p, size, s, mbcssize, NULL, 
NULL)) {
            PyErr_SetFromWindowsErrWithFilename(0, NULL);
            return -1;
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to