summaryrefslogtreecommitdiff
path: root/Modules/_io/winconsoleio.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 16:46:53 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 16:46:53 -0800
commitb1a1742796fce8078f9f1f3d5e3161122fae3b0a (patch)
tree89c863764481b7c7fbe645be42b16e1d35e92751 /Modules/_io/winconsoleio.c
parent391ed6c73cb1964b57d0b538370a76d03d30511b (diff)
parentcf1f5444eb42a8dc252b295d3863288309996a5d (diff)
downloadcpython-b1a1742796fce8078f9f1f3d5e3161122fae3b0a.tar.gz
Merge from 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 1ad0bfcdcd..a2607b4da2 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -198,8 +198,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;
@@ -306,11 +306,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);
@@ -392,11 +387,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");