diff --git a/src/synchronicity/synchronizer.py b/src/synchronicity/synchronizer.py index d671f12..09985c1 100644 --- a/src/synchronicity/synchronizer.py +++ b/src/synchronicity/synchronizer.py @@ -8,7 +8,6 @@ import functools import inspect import os -import platform import threading import types import typing @@ -106,12 +105,6 @@ def __init__( self._owner_pid = None self._stopping = None - if platform.system() == "Windows": - # default event loop policy on windows spits out errors when - # closing the event loop, so use WindowsSelectorEventLoopPolicy instead - # https://stackoverflow.com/questions/45600579/asyncio-event-loop-is-closed-when-getting-loop - asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) - # Special attribute we use to go from wrapped <-> original self._wrapped_attr = "_sync_wrapped_%d" % id(self) self._original_attr = "_sync_original_%d" % id(self) diff --git a/test/gevent_test.py b/test/gevent_test.py index 9edab80..d66e007 100644 --- a/test/gevent_test.py +++ b/test/gevent_test.py @@ -5,6 +5,9 @@ @pytest.mark.skipif(sys.version_info >= (3, 13), reason="gevent seems broken on Python 3.13") +@pytest.mark.skipif( + sys.platform == "win32", reason="gevent support broken on Windows, probably due to event loop patching" +) def test_gevent(): # Run it in a separate process because gevent modifies a lot of modules fn = Path(__file__).parent / "support" / "_gevent.py" diff --git a/test/shutdown_test.py b/test/shutdown_test.py index 2ed50e4..cb0af05 100644 --- a/test/shutdown_test.py +++ b/test/shutdown_test.py @@ -41,9 +41,7 @@ def test_shutdown(): p.stdout.readline() == "keyboard interrupt\n" ) # we want the keyboard interrupt to come *after* the running function has been cancelled! - stderr_content = p.stderr.read() - print("stderr:", stderr_content) - assert "Traceback" not in stderr_content + assert p.stderr.read().strip() == "" def test_keyboard_interrupt_reraised_as_is(synchronizer):