--- base_events.py 2015-07-26 16:50:10.000000000 +0300 +++ base_events_ctxmgr.py 2015-08-05 15:28:35.110044026 +0300 @@ -371,6 +371,12 @@ self._default_executor = None executor.shutdown(wait=False) + def __enter__(self): + return self + + def __exit__(self, *exc_info): + self.close() + def is_closed(self): """Returns True if the event loop was closed.""" return self._closed