commit:     1ff916c64ef911e710c02592478c467a9e99fe19
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 23 03:37:09 2025 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 23 03:52:45 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1ff916c6

Avoid asyncio.set_event_loop_policy after python 3.12

The corresponding issue was fixed in v3.12.0a2-134-g191708c56cf.

Bug: https://bugs.gentoo.org/963116
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 91b16f87a3..792225037f 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -416,7 +416,8 @@ class _ForkWatcher:
         _ForkWatcher.current_pid = None
         # Force instantiation of a new event loop policy as a workaround
         # for https://bugs.python.org/issue22087.
-        asyncio.set_event_loop_policy(None)
+        if sys.version_info < (3, 12):
+            asyncio.set_event_loop_policy(None)
 
 
 _ForkWatcher.hook(_ForkWatcher)

Reply via email to