From 2a3f38fd299c09be89a7872ccd15c4aedd5fc145 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 26 Jan 2015 15:03:44 +0100 Subject: [PATCH] asyncio: PipeHandle.fileno() now raises an exception if the pipe is closed --- Lib/asyncio/windows_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py index e6642960db3..5f8327eba63 100644 --- a/Lib/asyncio/windows_utils.py +++ b/Lib/asyncio/windows_utils.py @@ -147,6 +147,8 @@ class PipeHandle: return self._handle def fileno(self): + if self._handle is None: + raise ValueError("I/O operatioon on closed pipe") return self._handle def close(self, *, CloseHandle=_winapi.CloseHandle):