summaryrefslogtreecommitdiff
path: root/Modules/_io/winconsoleio.c
diff options
context:
space:
mode:
authorMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:18:39 -0800
committerMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:18:39 -0800
commit731cca110f376cdbaffb536e42d6c9d6da574fa8 (patch)
tree9cb95caf6f8b933115820bf699725d9cd600d2df /Modules/_io/winconsoleio.c
parentda79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (diff)
parentc8102f4d974669f4c5e4ca7bcd73292a1ac5bcbf (diff)
downloadcpython-731cca110f376cdbaffb536e42d6c9d6da574fa8.tar.gz
Issue #29371: merge with 3.6
Diffstat (limited to 'Modules/_io/winconsoleio.c')
-rw-r--r--Modules/_io/winconsoleio.c14
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");