mirror of https://github.com/python/cpython
Issue #808164: Fixed socket.close to avoid references to globals, to
avoid issues when socket.close is called from a __del__ method.
This commit is contained in:
parent
a606faa491
commit
19d6a4fd49
|
@ -172,10 +172,12 @@ class socket(_socket.socket):
|
||||||
if self._closed:
|
if self._closed:
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def _real_close(self):
|
def _real_close(self, _ss=_socket.socket):
|
||||||
_socket.socket.close(self)
|
# This function should not reference any globals. See Issue808164
|
||||||
|
_ss.close(self)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
# This function should not reference any globals. See Issue808164
|
||||||
self._closed = True
|
self._closed = True
|
||||||
if self._io_refs <= 0:
|
if self._io_refs <= 0:
|
||||||
self._real_close()
|
self._real_close()
|
||||||
|
|
|
@ -142,6 +142,9 @@ Extensions
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #808164: Fixed socket.close to avoid references to globals, to
|
||||||
|
avoid issues when socket.close is called from a __del__ method.
|
||||||
|
|
||||||
- Issue #9706: ssl module provides a better error handling in various
|
- Issue #9706: ssl module provides a better error handling in various
|
||||||
circumstances.
|
circumstances.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue