]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixes [ #430986 ] Buglet in PyUnicode_FromUnicode.
authorMarc-André Lemburg <mal@egenix.com>
Thu, 7 Jun 2001 12:26:56 +0000 (12:26 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Thu, 7 Jun 2001 12:26:56 +0000 (12:26 +0000)
Objects/unicodeobject.c

index 84de8ca5cbde07bf9f258a4636fd55c7b36ca701..3b4347b44450701a61b508181eea9abbdd742ea8 100644 (file)
@@ -297,9 +297,9 @@ PyObject *PyUnicode_FromUnicode(const Py_UNICODE *u,
            unicode = unicode_latin1[*u];
            if (!unicode) {
                unicode = _PyUnicode_New(1);
-               unicode->str[0] = *u;
                if (!unicode)
                    return NULL;
+               unicode->str[0] = *u;
                unicode_latin1[*u] = unicode;
            }
            Py_INCREF(unicode);