diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/socket.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 9b4beda..9ed2de9 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -189,7 +189,9 @@ class _socketobject(object): for method in _delegate_methods: setattr(self, method, getattr(_sock, method)) - def close(self): + def close(self, _closedsocket=_closedsocket, + _delegate_methods=_delegate_methods, setattr=setattr): + # This function should not reference any globals. See issue #808164. self._sock = _closedsocket() dummy = self._sock._dummy for method in _delegate_methods: |