diff options
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 1378b0f..d4f1b65 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -324,12 +324,23 @@ class SocketIO(io.RawIOBase): def readable(self): """True if the SocketIO is open for reading. """ - return self._reading and not self.closed + if self.closed: + raise ValueError("I/O operation on closed socket.") + return self._reading def writable(self): """True if the SocketIO is open for writing. """ - return self._writing and not self.closed + if self.closed: + raise ValueError("I/O operation on closed socket.") + return self._writing + + def seekable(self): + """True if the SocketIO is open for seeking. + """ + if self.closed: + raise ValueError("I/O operation on closed socket.") + return super().seekable() def fileno(self): """Return the file descriptor of the underlying socket. |