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

examples/pair1_async.py uses deprecated method #44

Closed
MauiJerry opened this issue Aug 6, 2019 · 1 comment
Closed

examples/pair1_async.py uses deprecated method #44

MauiJerry opened this issue Aug 6, 2019 · 1 comment

Comments

@MauiJerry
Copy link

Trying out the pair1_async example after installing Trio (latest = 0.12.0) i got the message ...

TrioDeprecationWarning: trio.run_sync_in_worker_thread is deprecated since Trio 0.12.0; use trio.to_thread.to_thread_run_sync instead (python-trio/trio#810)

but be aware that deprecated suggestion is wrong, due to trio/to_thread importing the function as run_sync() so the updated line should be

   stuff = await trio.to_thread.run_sync(input, cancellable=True)
@codypiersall
Copy link
Owner

Thanks for pointing this out. This is fixed now in baaee03. The example should work on older or newer versions of trio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants