Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #102 from beeware/py3.12-compat
Browse files Browse the repository at this point in the history
Updated test suite to remove use of generators as co-routines.
  • Loading branch information
freakboy3742 authored Sep 11, 2023
2 parents 04004a1 + 864cdb8 commit 42a7559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes/78.bugfix.rst
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 5 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 42a7559

Please sign in to comment.