Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable the cython binding=True directive #484

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@ async def coro():
self.loop.set_task_factory(None)
self.assertIsNone(self.loop.get_task_factory())

def test_asyncgen_hooks(self):
async def acall(fn):
return fn()

# for sniffio to detect uvloop as asyncio efficiently the running loop
# call_soon module needs to match the asyncgen_hooks module
hooks = self.loop.run_until_complete(acall(sys.get_asyncgen_hooks))
self.assertEqual(hooks.finalizer.__module__, "uvloop.loop")
self.assertEqual(self.loop.call_soon.__module__, "uvloop.loop")

def test_shutdown_asyncgens_01(self):
finalized = list()

Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: language_level=3
# cython: language_level=3, embedsignature=True, binding=True


from .includes cimport uv
Expand Down
2 changes: 1 addition & 1 deletion uvloop/loop.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: language_level=3, embedsignature=True
# cython: language_level=3, embedsignature=True, binding=True

import asyncio
cimport cython
Expand Down