Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/irc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ buildPythonPackage (finalAttrs: {
hash = "sha256-jdv9GfcSBM7Ount8cnJLFbP6h7q16B5Fp1vvc2oaPHY=";
};

patches = [
# https://github.com/jaraco/irc/pull/236
./python-3.14-event-loop.patch
];

nativeBuildInputs = [ setuptools-scm ];

propagatedBuildInputs = [
Expand Down
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/irc/python-3.14-event-loop.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- 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
)
Loading