diff options
-rwxr-xr-x | PC/msvcrtmodule.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index 982c45879e..e110ed8b09 100755 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -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 * |