]> granicus.if.org Git - python/commitdiff
Stupid save all didn't safe it all ...
authorChristian Heimes <christian@cheimes.de>
Mon, 10 Dec 2007 15:39:09 +0000 (15:39 +0000)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Dec 2007 15:39:09 +0000 (15:39 +0000)
PC/msvcrtmodule.c

index 982c45879eacad3f3336129b8d27cf3ca64ab4f3..e110ed8b091c4a13dcb93b7b1c49c272e8b1fcd9 100755 (executable)
@@ -214,13 +214,14 @@ msvcrt_putwch(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "u#:putwch", &ch, &size))
                return NULL;
 
-       if (size == 1)
-               _putwch(*ch);
-               Py_RETURN_NONE;
-       else {
+       if (size == 0) {
                PyErr_SetString(PyExc_ValueError,
-                       "Expected unicode of length 1");
+                       "Expected unicode string of length 1");
+               return NULL;
        }
+       _putwch(*ch);
+       Py_RETURN_NONE;
+
 }
 
 static PyObject *