Skip to content

Commit

Permalink
Remove current_{run,await}_in_trio_thread
Browse files Browse the repository at this point in the history
These were deprecated in 0.2.0 (see python-triogh-68)
  • Loading branch information
njsmith committed Dec 25, 2017
1 parent 787a3c7 commit b01d9f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
13 changes: 0 additions & 13 deletions trio/_threads.py
Expand Up @@ -6,11 +6,8 @@

from . import _core
from ._sync import CapacityLimiter
from ._deprecate import deprecated

__all__ = [
"current_await_in_trio_thread",
"current_run_in_trio_thread",
"run_sync_in_worker_thread",
"current_default_worker_thread_limiter",
"BlockingTrioPortal",
Expand Down Expand Up @@ -123,16 +120,6 @@ def run_sync(self, fn, *args):
return self._do_it(self._run_sync_cb, fn, *args)


@deprecated("0.2.0", issue=68, instead=BlockingTrioPortal.run_sync)
def current_run_in_trio_thread():
return BlockingTrioPortal().run_sync


@deprecated("0.2.0", issue=68, instead=BlockingTrioPortal.run)
def current_await_in_trio_thread():
return BlockingTrioPortal().run


################################################################

# XX at some point it probably makes sense to implement some sort of thread
Expand Down
18 changes: 0 additions & 18 deletions trio/tests/test_threads.py
Expand Up @@ -463,21 +463,3 @@ def bad_start(self):
assert "engines" in str(excinfo.value)

assert limiter.borrowed_tokens == 0


# can remove after deleting 0.2.0 deprecations
async def test_deprecated_portal_API(recwarn):
trio_thread = threading.current_thread()

async def async_current_thread():
return threading.current_thread()

def worker_thread(run_in_trio_thread, await_in_trio_thread):
assert run_in_trio_thread(threading.current_thread) == trio_thread
assert await_in_trio_thread(async_current_thread) == trio_thread

run_in_trio_thread = current_run_in_trio_thread()
await_in_trio_thread = current_await_in_trio_thread()
await run_sync_in_worker_thread(
worker_thread, run_in_trio_thread, await_in_trio_thread
)

0 comments on commit b01d9f6

Please sign in to comment.