There was an error while loading. Please reload this page.
1 parent 8966c99 commit 435b0f2Copy full SHA for 435b0f2
1 file changed
PC/msvcrtmodule.c
@@ -220,18 +220,12 @@ msvcrt_putch(PyObject *self, PyObject *args)
220
static PyObject *
221
msvcrt_putwch(PyObject *self, PyObject *args)
222
{
223
- Py_UNICODE *ch;
224
- int size;
+ int ch;
225
226
- if (!PyArg_ParseTuple(args, "u#:putwch", &ch, &size))
+ if (!PyArg_ParseTuple(args, "C:putwch", &ch))
227
return NULL;
228
229
- if (size == 0) {
230
- PyErr_SetString(PyExc_ValueError,
231
- "Expected unicode string of length 1");
232
- return NULL;
233
- }
234
- _putwch(*ch);
+ _putwch(ch);
235
Py_RETURN_NONE;
236
237
}
@@ -255,12 +249,12 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
255
249
256
250
msvcrt_ungetwch(PyObject *self, PyObject *args)
257
251
258
- Py_UNICODE ch;
252
259
253
260
- if (!PyArg_ParseTuple(args, "u:ungetwch", &ch))
254
+ if (!PyArg_ParseTuple(args, "C:ungetwch", &ch))
261
262
263
- if (_ungetch(ch) == EOF)
+ if (_ungetwch(ch) == WEOF)
264
return PyErr_SetFromErrno(PyExc_IOError);
265
Py_INCREF(Py_None);
266
return Py_None;
0 commit comments