diff --git a/changes/78.bugfix.rst b/changes/78.bugfix.rst new file mode 100644 index 0000000..ce9e2c8 --- /dev/null +++ b/changes/78.bugfix.rst @@ -0,0 +1 @@ +Support for using a generator as a co-routine has been removed, in line with the change in behavior in Python 3.12. Python 3.11 and earlier will still support this usage, but it is no longer verified as part of GBulb. diff --git a/tests/test_utils.py b/tests/test_utils.py index cad600b..464bb7f 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -76,8 +76,7 @@ class TestObject(GObject.GObject): t = TestObject() - def emitter(): - yield + async def emitter(): t.emit("foo", "frozen brains tell no tales") called = False @@ -115,16 +114,16 @@ class TestObject(GObject.GObject): t = TestObject() - def emitter(): - yield + async def emitter(): t.emit("foo", "frozen brains tell no tales") called = False cancelled = False - def waiter(): + async def waiter(): nonlocal cancelled - yield + # Yield to the event loop + await asyncio.sleep(0) r = wait_signal(t, "foo")