Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 761538 - sys-apps/portage: [TRACKER] add asyncio.get_running_loop() and asyncio.run(coro) compat shims and migrate to them
Summary: sys-apps/portage: [TRACKER] add asyncio.get_running_loop() and asyncio.run(co...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 763339
Blocks: 758719
  Show dependency tree
 
Reported: 2020-12-24 23:42 UTC by Zac Medico
Modified: 2021-09-22 04:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2020-12-24 23:42:11 UTC
Since python3.7, the asyncio.get_running_loop() and asyncio.run(coro) functions are the preferred ways to access and run event loops. The asyncio.get_running_loop() function makes it possible to avoid passing around event loop instances in order to accommodate loops running in non-main threads (see the fix for bug 737698). For python3.6 compatibility, we can add shims for these functions in the portage.util.futures.asyncio module.
Comment 1 Zac Medico gentoo-dev 2021-09-22 04:38:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=631bedffe29124d693de3b539fc908d9feec1420

commit 631bedffe29124d693de3b539fc908d9feec1420
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-09-19 22:05:38 -0700
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-09-19 22:08:47 -0700

    _safe_loop: fix python3.10 DeprecationWarning
    
    DeprecationWarning: There is no current event loop
    
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/util/futures/_asyncio/__init__.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)