#9354: Provide getsockopt() in asyncore file_wrapper().  Patch by Lukas Langa.
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 @@
         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