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

Switch to using standalone Outcome library. #503

Merged
merged 15 commits into from
Apr 21, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def setup(app):

intersphinx_mapping = {
"python": ('https://docs.python.org/3', None),
"outcome": ('https://outcome.readthedocs.org', None),
"outcome": ('https://outcome.readthedocs.org/en/latest/', None),
}

autodoc_member_order = "bysource"
Expand Down
16 changes: 16 additions & 0 deletions trio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@
from . import abc
from . import ssl
# Not imported by default: testing
_deprecate.enable_attribute_deprecations(hazmat.__name__)

__deprecated_attributes__ = {
"Result":
_deprecate.DeprecatedAttribute(
hazmat.Result, "0.5.0", issue=494, instead="outcome.Outcome"
),
"Value":
_deprecate.DeprecatedAttribute(
hazmat.Value, "0.5.0", issue=494, instead="outcome.Value"
),
"Error":
_deprecate.DeprecatedAttribute(
hazmat.Error, "0.5.0", issue=494, instead="outcome.Error"
)
}

# Having the public path in .__module__ attributes is important for:
# - exception names in printed tracebacks
Expand Down
17 changes: 1 addition & 16 deletions trio/_core/_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,4 @@ async def acapture(cls, async_fn, *args):
# ensure that isinstance(Value(), Result)/issubclass(Value, Result) and etc
# don't break
Result.register(Value)
Result.register(Error)

__deprecated_attributes__ = {
"Result":
_deprecate.DeprecatedAttribute(
Result, "0.5.0", issue=494, instead="outcome.Outcome"
),
"Value":
_deprecate.DeprecatedAttribute(
Value, "0.5.0", issue=494, instead="outcome.Value"
),
"Error":
_deprecate.DeprecatedAttribute(
Error, "0.5.0", issue=494, instead="outcome.Error"
)
}
Result.register(Error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ugh. Could you please keep the newline?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, missed that. Surprised yapf didn't catch it.