public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-irc] epel9: Fix build with Python 3.14
@ 2026-10-02 8:19
0 siblings, 0 replies; only message in thread
From: @ 2026-10-02 8:19 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-irc
Branch : epel9
Commit : ecceb2f4f44b6d35cd72a681c25f69458508671c
Author : Ondrej Mosnáček <omosnacek@gmail.com>
Date : 2025-06-10T12:44:59+02:00
Stats : +52/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-irc/c/ecceb2f4f44b6d35cd72a681c25f69458508671c?branch=epel9
Log:
Fix build with Python 3.14
Backport the PR with the fix.
Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>
---
diff --git a/001-fix-for-py314.patch b/001-fix-for-py314.patch
new file mode 100644
index 0000000..c88b406
--- /dev/null
+++ b/001-fix-for-py314.patch
@@ -0,0 +1,49 @@
+From 074b807361164e1522b64a225f4647a8b4bb53b8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= <omosnacek@gmail.com>
+Date: Sat, 23 Nov 2024 10:25:44 +0100
+Subject: [PATCH] Fix "There is no current event loop" in the asyncio test
+
+This bug is causing the test to fail under Python 3.14. Fix it by
+calling asyncio.new_event_loop() and asyncio.set_event_loop() as
+recommended in: https://stackoverflow.com/a/73367187
+
+Fixes #197
+---
+ irc/tests/test_client_aio.py | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/irc/tests/test_client_aio.py b/irc/tests/test_client_aio.py
+index 962cbde..00a02f6 100644
+--- a/irc/tests/test_client_aio.py
++++ b/irc/tests/test_client_aio.py
+@@ -1,6 +1,4 @@
+ import asyncio
+-import contextlib
+-import warnings
+ from unittest.mock import MagicMock
+
+ from irc import client_aio
+@@ -13,21 +11,14 @@ async def mock_create_connection(*args, **kwargs):
+ return mock_create_connection
+
+
+-@contextlib.contextmanager
+-def suppress_issue_197():
+- with warnings.catch_warnings():
+- warnings.filterwarnings('ignore', 'There is no current event loop')
+- yield
+-
+-
+ def test_privmsg_sends_msg():
+ # create dummy transport, protocol
+ mock_transport = MagicMock()
+ mock_protocol = MagicMock()
+
+ # connect to dummy server
+- with suppress_issue_197():
+- loop = asyncio.get_event_loop()
++ loop = asyncio.new_event_loop()
++ asyncio.set_event_loop(loop)
+ loop.create_connection = make_mocked_create_connection(
+ mock_transport, mock_protocol
+ )
diff --git a/python-irc.spec b/python-irc.spec
index 0e64c2d..ce3be70 100644
--- a/python-irc.spec
+++ b/python-irc.spec
@@ -19,6 +19,8 @@ License: MIT
URL: https://github.com/jaraco/%{projname}
Source0: %{pypi_source %{projname}}
+Patch1: %{url}/pull/236.patch#/001-fix-for-py314.patch
+
BuildArch: noarch
BuildRequires: python3-devel
@@ -39,7 +41,7 @@ Summary: %{summary}
%description -n python3-%{projname} %_description
%prep
-%autosetup -n %{projname}-%{version}
+%autosetup -p1 -n %{projname}-%{version}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -E -i '/\t"pytest-/d' pyproject.toml
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-02 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 8:19 [rpms/python-irc] epel9: Fix build with Python 3.14
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox