Yury Selivanov added the comment:

>> Update some places in asyncio where we currently use "get_event_loop()", 
>> such as Future constructor, Task.current_task, etc.

> Yury, do you have an idea how it could be done?

I think I do.  To keep the backwards compatibility, we'll need to update the 
"get_event_loop()" function as follows:

  def get_event_loop():
     loop = _running_loop.loop
     if loop is None:
         loop = get_event_loop_old_impl()
     return loop

No need to actually update Future or Task or any other asyncio code.

The get_running_loop() would look like this:

  def get_running_loop():
     loop = _running_loop.loop
     if loop is None:
         raise RuntimeError('no running event loop')
     return loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26969>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to