diff --git a/newsfragments/1167.bugfix.rst b/newsfragments/1167.bugfix.rst new file mode 100644 index 0000000000..428fb563f5 --- /dev/null +++ b/newsfragments/1167.bugfix.rst @@ -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.) diff --git a/trio/__init__.py b/trio/__init__.py index ab75cd38b4..6e9035d8fd 100644 --- a/trio/__init__.py +++ b/trio/__init__.py @@ -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__) @@ -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: diff --git a/trio/tests/test_threads.py b/trio/tests/test_threads.py index b9991a9dcf..29d44adc4a 100644 --- a/trio/tests/test_threads.py +++ b/trio/tests/test_threads.py @@ -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