Skip to content

Commit 645dfa3

Browse files
committed
bpo-30555: Fix refleaks
The change in test_winconsoleio.py is only to avoid the ref leak in `sys.getwindowsversion`.
1 parent ac242eb commit 645dfa3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Modules/_io/winconsoleio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
308308
self->fd = fd;
309309

310310
if (fd < 0) {
311-
PyObject *decodedname = Py_None;
312-
Py_INCREF(decodedname);
311+
PyObject *decodedname = NULL;
313312

314313
int d = PyUnicode_FSDecoder(nameobj, (void*)&decodedname);
315314
if (!d)

0 commit comments

Comments
 (0)