diff options
author | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:18:39 -0800 |
---|---|---|
committer | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:18:39 -0800 |
commit | 731cca110f376cdbaffb536e42d6c9d6da574fa8 (patch) | |
tree | 9cb95caf6f8b933115820bf699725d9cd600d2df /Modules/_io/winconsoleio.c | |
parent | da79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (diff) | |
parent | c8102f4d974669f4c5e4ca7bcd73292a1ac5bcbf (diff) | |
download | cpython-731cca110f376cdbaffb536e42d6c9d6da574fa8.tar.gz |
Issue #29371: merge with 3.6
Diffstat (limited to 'Modules/_io/winconsoleio.c')
-rw-r--r-- | Modules/_io/winconsoleio.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 1d169e2764..4d36bb5d2f 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -210,8 +210,8 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self) PyObject *exc, *val, *tb; int rc; _Py_IDENTIFIER(close); - res = _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type, - &PyId_close, "O", self); + res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type, + &PyId_close, self, NULL); if (!self->closehandle) { self->handle = INVALID_HANDLE_VALUE; return res; @@ -318,11 +318,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj, Py_CLEAR(decodedname); if (name == NULL) return -1; - if (console_type == '\0') { - PyErr_SetString(PyExc_ValueError, - "Cannot open non-console file"); - return -1; - } if (wcslen(name) != length) { PyMem_Free(name); @@ -404,11 +399,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj, if (console_type == '\0') console_type = _get_console_type(self->handle); - if (console_type == '\0') { - PyErr_SetString(PyExc_ValueError, - "Cannot open non-console file"); - goto error; - } if (self->writable && console_type != 'w') { PyErr_SetString(PyExc_ValueError, "Cannot open console input buffer for writing"); |