diff options
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 9dbe550..4b40356 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -18,7 +18,6 @@ except ImportError: # pragma: no cover ssl = None from . import base_events -from . import compat from . import constants from . import events from . import futures @@ -621,15 +620,11 @@ class _SelectorTransport(transports._FlowControlMixin, self._loop._remove_writer(self._sock_fd) self._loop.call_soon(self._call_connection_lost, None) - # On Python 3.3 and older, objects with a destructor part of a reference - # cycle are never destroyed. It's not more the case on Python 3.4 thanks - # to the PEP 442. - if compat.PY34: - def __del__(self): - if self._sock is not None: - warnings.warn("unclosed transport %r" % self, ResourceWarning, - source=self) - self._sock.close() + def __del__(self): + if self._sock is not None: + warnings.warn("unclosed transport %r" % self, ResourceWarning, + source=self) + self._sock.close() def _fatal_error(self, exc, message='Fatal error on transport'): # Should be called from exception handler only. |