mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
parent
656aa28cd5
commit
44309e6b37
8 changed files with 24 additions and 16 deletions
|
@ -198,10 +198,12 @@ class SocketIO(io.RawIOBase):
|
|||
# XXX More docs
|
||||
|
||||
def __init__(self, sock, mode):
|
||||
if mode not in ("r", "w", "rw"):
|
||||
if mode not in ("r", "w", "rw", "rb", "wb", "rwb"):
|
||||
raise ValueError("invalid mode: %r" % mode)
|
||||
io.RawIOBase.__init__(self)
|
||||
self._sock = sock
|
||||
if "b" not in mode:
|
||||
mode += "b"
|
||||
self._mode = mode
|
||||
self._reading = "r" in mode
|
||||
self._writing = "w" in mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue