summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/winconsoleio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index d51df7e..781518a 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -101,7 +101,7 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
DWORD length;
wchar_t name_buf[MAX_PATH], *pname_buf = name_buf;
-
+
length = GetFullPathNameW(decoded_wstr, MAX_PATH, pname_buf, NULL);
if (length > MAX_PATH) {
pname_buf = PyMem_New(wchar_t, length);
@@ -298,8 +298,7 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
self->fd = fd;
if (fd < 0) {
- PyObject *decodedname = Py_None;
- Py_INCREF(decodedname);
+ PyObject *decodedname;
int d = PyUnicode_FSDecoder(nameobj, (void*)&decodedname);
if (!d)