]> granicus.if.org Git - python/commitdiff
asyncio: PipeHandle.fileno() now raises an exception if the pipe is closed
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 26 Jan 2015 14:03:44 +0000 (15:03 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 26 Jan 2015 14:03:44 +0000 (15:03 +0100)
Lib/asyncio/windows_utils.py

index e6642960db37cea99f01fcfda35baccb55c6921d..5f8327eba63aa3827fc3398e26500121f1e76729 100644 (file)
@@ -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):