asyncio: Sync with upstream (compat module)

This commit is contained in:
Yury Selivanov 2015-08-04 15:56:33 -04:00
parent 996083d6e6
commit 2a8911c0b7
7 changed files with 14 additions and 16 deletions

View file

@ -28,6 +28,7 @@ import traceback
import sys
import warnings
from . import compat
from . import coroutines
from . import events
from . import futures
@ -378,7 +379,7 @@ class BaseEventLoop(events.AbstractEventLoop):
# 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 sys.version_info >= (3, 4):
if compat.PY34:
def __del__(self):
if not self.is_closed():
warnings.warn("unclosed event loop %r" % self, ResourceWarning)