Issue #11127: Raise a TypeError when trying to pickle a socket object.
diff --git a/Lib/socket.py b/Lib/socket.py
index 1e28549..5715034 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -112,6 +112,9 @@
                                 s[7:])
         return s
 
+    def __getstate__(self):
+        raise TypeError("Cannot serialize socket object")
+
     def dup(self):
         """dup() -> socket object