diff options
author | Georg Brandl <georg@python.org> | 2010-07-28 08:19:35 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-07-28 08:19:35 (GMT) |
commit | cbb0ae4a428bae3f5c29a1f8974121bb195299ef (patch) | |
tree | 23b2d8b246b7dbaddf966dcf50ccbeca601fd173 /Lib/asyncore.py | |
parent | 8182b717dbedc5d864a2240e6ff9120ecb2607dc (diff) | |
download | cpython-cbb0ae4a428bae3f5c29a1f8974121bb195299ef.zip cpython-cbb0ae4a428bae3f5c29a1f8974121bb195299ef.tar.gz cpython-cbb0ae4a428bae3f5c29a1f8974121bb195299ef.tar.bz2 |
#9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa.
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r-- | Lib/asyncore.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index c2ec259..fba55e0 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -607,6 +607,14 @@ if os.name == 'posix': def send(self, *args): return os.write(self.fd, *args) + def getsockopt(self, level, optname, buflen=None): + if (level == socket.SOL_SOCKET and + optname == socket.SO_ERROR and + not buflen): + return 0 + raise NotImplementedError("Only asyncore specific behaviour " + "implemented.") + read = recv write = send |