]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In PyFile_WriteString(), call PyUnicode_FromString() instead of
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 22:58:05 +0000 (22:58 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 22:58:05 +0000 (22:58 +0000)
PyString_FromString().  This is arguably more correct, even if it
shouldn't matter much (all the input is likely to be ASCII).

Objects/fileobject.c

index 372cf433ca23b0ccfa2d5d46fa460c1bec56bc2a..34bca682d0ef5fc4a7be38c5dbe02f2eb35b7d36 100644 (file)
@@ -177,7 +177,7 @@ PyFile_WriteString(const char *s, PyObject *f)
                return -1;
        }
        else if (!PyErr_Occurred()) {
-               PyObject *v = PyString_FromString(s);
+               PyObject *v = PyUnicode_FromString(s);
                int err;
                if (v == NULL)
                        return -1;