From b7b2436bc17967f48bb16e252dd309a471058430 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 23 Feb 2021 06:48:15 -0500 Subject: [PATCH] Remove tractor run from some debug examples --- examples/debugging/multi_daemon_subactors.py | 11 +++++++---- ...lti_nested_subactors_error_up_through_nurseries.py | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/debugging/multi_daemon_subactors.py b/examples/debugging/multi_daemon_subactors.py index b834a02..eadb4c1 100644 --- a/examples/debugging/multi_daemon_subactors.py +++ b/examples/debugging/multi_daemon_subactors.py @@ -17,10 +17,13 @@ async def name_error(): async def main(): """Test breakpoint in a streaming actor. """ - async with tractor.open_nursery() as n: + async with tractor.open_nursery( + debug_mode=True, + loglevel='error', + ) as n: - p0 = await n.start_actor('bp_forever', rpc_module_paths=[__name__]) - p1 = await n.start_actor('name_error', rpc_module_paths=[__name__]) + p0 = await n.start_actor('bp_forever', enable_modules=[__name__]) + p1 = await n.start_actor('name_error', enable_modules=[__name__]) # retreive results stream = await p0.run(breakpoint_forever) @@ -28,4 +31,4 @@ async def main(): if __name__ == '__main__': - tractor.run(main, debug_mode=True, loglevel='error') + trio.run(main) diff --git a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py index 82b4def..e754599 100644 --- a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py +++ b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py @@ -1,3 +1,4 @@ +import trio import tractor @@ -50,7 +51,9 @@ async def main(): └─ python -m tractor._child --uid ('spawn_until_0', 'de918e6d ...) """ - async with tractor.open_nursery() as n: + async with tractor.open_nursery( + debug_mode=True, + ) as n: # spawn both actors portal = await n.run_in_actor( @@ -70,4 +73,4 @@ async def main(): if __name__ == '__main__': - tractor.run(main, debug_mode=True) + trio.run(main)