public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python-irc] epel9: Fix build with Python 3.14
Date: Fri, 02 Oct 2026 08:19:59 GMT	[thread overview]
Message-ID: <179092919921.1.2660611065679172276.rpms-python-irc-ecceb2f4f44b@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-10-02  8:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179092919921.1.2660611065679172276.rpms-python-irc-ecceb2f4f44b@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox