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

Added helpful error message if an async function is passed to trio.to_thread_run_sync #1575

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

guilledk
Copy link

@guilledk guilledk commented Jun 4, 2020

This functionality was previously added to the trio.from_thread functions in #1513

Closes #1573

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Two minor things left.

newsfragments/1573.bugfix.rst Outdated Show resolved Hide resolved
trio/tests/test_threads.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #1575 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1575      +/-   ##
==========================================
- Coverage   99.69%   99.69%   -0.01%     
==========================================
  Files         111      109       -2     
  Lines       13866    13817      -49     
  Branches     1059     1056       -3     
==========================================
- Hits        13824    13775      -49     
  Misses         27       27              
  Partials       15       15              
Impacted Files Coverage Δ
trio/_threads.py 100.00% <100.00%> (ø)
trio/tests/test_threads.py 100.00% <100.00%> (ø)
trio/tests/test_exports.py 97.22% <0.00%> (-0.15%) ⬇️
trio/__init__.py 100.00% <0.00%> (ø)
trio/tests/test_deprecate.py 100.00% <0.00%> (ø)
trio/_deprecated_subprocess_reexports.py
trio/_deprecated_ssl_reexports.py
trio/_core/_run.py 99.76% <0.00%> (+<0.01%) ⬆️

@oremanj oremanj merged commit d1a0a2c into python-trio:master Jun 9, 2020
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

Successfully merging this pull request may close these issues.

Give a better diagnostic if user does trio.to_thread.run_sync(async_fn)
3 participants