Skip to content

Commit

Permalink
Put BlockingTrioPortal back where it's supposed to be.
Browse files Browse the repository at this point in the history
When it was deprecated in python-triogh-1122, it accidentally got moved into
trio.hazmat.

Fixes: python-triogh-1167
  • Loading branch information
njsmith committed Aug 1, 2019
1 parent 04e92f6 commit da5f90c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions newsfragments/1167.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In v0.12.0, we accidentally moved ``BlockingTrioPortal`` from ``trio``
to ``trio.hazmat``. It's now been restored to its proper position.
(It's still deprecated though, and will issue a warning if you use it.)
14 changes: 7 additions & 7 deletions trio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@
"0.12.0",
issue=810,
),
"BlockingTrioPortal":
_deprecate.DeprecatedAttribute(
_BlockingTrioPortal,
"0.12.0",
issue=810,
instead=from_thread,
),
}

_deprecate.enable_attribute_deprecations(hazmat.__name__)
Expand Down Expand Up @@ -143,13 +150,6 @@
"0.12.0",
issue=878,
),
"BlockingTrioPortal":
_deprecate.DeprecatedAttribute(
_BlockingTrioPortal,
"0.12.0",
issue=810,
instead=from_thread,
),
}

# Having the public path in .__module__ attributes is important for:
Expand Down
6 changes: 6 additions & 0 deletions trio/tests/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,9 @@ def worker_thread(token):

t = await to_thread_run_sync(worker_thread, token)
assert t == threading.current_thread()


def test_BlockingTrioPortal_deprecated_export(recwarn):
import trio
btp = trio.BlockingTrioPortal
assert btp is BlockingTrioPortal

0 comments on commit da5f90c

Please sign in to comment.