eryksun added the comment: I forgot to first check whether p2cread is None:
ERROR_INVALID_HANDLE = 0x0006 if stdin is None: p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE) if p2cread is not None: try: os.get_handle_inheritable(p2cread) except OSError as e: if e.winerror != ERROR_INVALID_HANDLE: raise p2cread = None if p2cread is None: p2cread, _ = _winapi.CreatePipe(None, 0) p2cread = Handle(p2cread) _winapi.CloseHandle(_) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25492> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com