Skip to content

Commit da5f90c

Browse files
committed
Put BlockingTrioPortal back where it's supposed to be.
When it was deprecated in python-triogh-1122, it accidentally got moved into trio.hazmat. Fixes: python-triogh-1167
1 parent 04e92f6 commit da5f90c

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

newsfragments/1167.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In v0.12.0, we accidentally moved ``BlockingTrioPortal`` from ``trio``
2+
to ``trio.hazmat``. It's now been restored to its proper position.
3+
(It's still deprecated though, and will issue a warning if you use it.)

trio/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@
115115
"0.12.0",
116116
issue=810,
117117
),
118+
"BlockingTrioPortal":
119+
_deprecate.DeprecatedAttribute(
120+
_BlockingTrioPortal,
121+
"0.12.0",
122+
issue=810,
123+
instead=from_thread,
124+
),
118125
}
119126

120127
_deprecate.enable_attribute_deprecations(hazmat.__name__)
@@ -143,13 +150,6 @@
143150
"0.12.0",
144151
issue=878,
145152
),
146-
"BlockingTrioPortal":
147-
_deprecate.DeprecatedAttribute(
148-
_BlockingTrioPortal,
149-
"0.12.0",
150-
issue=810,
151-
instead=from_thread,
152-
),
153153
}
154154

155155
# Having the public path in .__module__ attributes is important for:

trio/tests/test_threads.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,3 +560,9 @@ def worker_thread(token):
560560

561561
t = await to_thread_run_sync(worker_thread, token)
562562
assert t == threading.current_thread()
563+
564+
565+
def test_BlockingTrioPortal_deprecated_export(recwarn):
566+
import trio
567+
btp = trio.BlockingTrioPortal
568+
assert btp is BlockingTrioPortal

0 commit comments

Comments
 (0)