Delay deciding which cancel scope a Cancelled exception belongs to#901
Delay deciding which cancel scope a Cancelled exception belongs to#901oremanj merged 3 commits intopython-trio:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #901 +/- ##
==========================================
- Coverage 99.53% 99.53% -0.01%
==========================================
Files 102 102
Lines 12411 12397 -14
Branches 916 915 -1
==========================================
- Hits 12353 12339 -14
Misses 36 36
Partials 22 22
|
Codecov Report
@@ Coverage Diff @@
## master #901 +/- ##
==========================================
- Coverage 99.53% 99.53% -0.01%
==========================================
Files 102 102
Lines 12411 12409 -2
Branches 916 915 -1
==========================================
- Hits 12353 12351 -2
Misses 36 36
Partials 22 22
|
njsmith
left a comment
There was a problem hiding this comment.
Huh, this is simpler than I was expecting :-)
trio/_core/_exceptions.py
Outdated
| crash your program. Use :meth:`cancel_scope.cancel() | ||
| <trio.CancelScope.cancel>` instead, so Trio can maintain the | ||
| invariant that a :exc:`Cancelled` exception only gets raised when | ||
| there's a cancelled cancel scope that's intended to catch it. |
There was a problem hiding this comment.
This is probably more details on the internals than we really want people thinking about. How about simplifying down to just: "You cannot raise Cancelled yourself. Attempting to do so will produce a RuntimeError. Use cancel_scope.cancel instead."
|
The 3.8-dev failure in Travis is unrelated, so I think this is ready. |
|
LGTM. That travis failure is annoying... I just filed a bug on CPython (bpo-35894), so hopefully it will be fixed soon. In the mean time though our CI is broken. I guess we need to temporarily disable the 3.8-dev test (or mark it "allowed to fail") until that's fixed? |
|
Closing/opening to tickle CI, now that #905 is merged. |
|
This time |
Fixes python-trio#320. Now that python-trio#901 is implemented, the concerns discussed in python-trio#835 don't apply.
Fixes #860.