summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 6624ac1..3ff511b 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -29,7 +29,6 @@ import sys
import warnings
import weakref
-from . import compat
from . import coroutines
from . import events
from . import futures
@@ -499,16 +498,12 @@ class BaseEventLoop(events.AbstractEventLoop):
"""Returns True if the event loop was closed."""
return self._closed
- # 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 not self.is_closed():
- warnings.warn("unclosed event loop %r" % self, ResourceWarning,
- source=self)
- if not self.is_running():
- self.close()
+ def __del__(self):
+ if not self.is_closed():
+ warnings.warn("unclosed event loop %r" % self, ResourceWarning,
+ source=self)
+ if not self.is_running():
+ self.close()
def is_running(self):
"""Returns True if the event loop is running."""