summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-03-20 22:56:36 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-03-20 22:56:36 (GMT)
commit6d58d64919bb12e05fa4bf3a34909650c695cff6 (patch)
treea8b7d7915779a6cc30f7f6a9d69191d7bd34a002 /Lib/socket.py
parentb938bcd211bfcab13be38200a2f59947691118bb (diff)
downloadcpython-6d58d64919bb12e05fa4bf3a34909650c695cff6.zip
cpython-6d58d64919bb12e05fa4bf3a34909650c695cff6.tar.gz
cpython-6d58d64919bb12e05fa4bf3a34909650c695cff6.tar.bz2
Issue #11127: Raise a TypeError when trying to pickle a socket object.
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py3
1 files changed, 3 insertions, 0 deletions
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 @@ class socket(_socket.socket):
s[7:])
return s
+ def __getstate__(self):
+ raise TypeError("Cannot serialize socket object")
+
def dup(self):
"""dup() -> socket object