Issue #11127: Raise a TypeError when trying to pickle a socket object.

This commit is contained in:
Antoine Pitrou 2011-03-20 23:56:36 +01:00
parent b938bcd211
commit 6d58d64919
3 changed files with 12 additions and 0 deletions

View file

@ -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