From e3c26943baad06b2142d9017ad427833ac68addf Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 13 Oct 2020 14:20:44 -0400 Subject: [PATCH] Support debug mode only on the trio backend --- tractor/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tractor/__init__.py b/tractor/__init__.py index d3aedc4..5ed843f 100644 --- a/tractor/__init__.py +++ b/tractor/__init__.py @@ -63,11 +63,13 @@ async def _main( if start_method is not None: _spawn.try_set_start_method(start_method) - if debug_mode: + if debug_mode and _spawn._spawn_method == 'trio': _state._runtime_vars['_debug_mode'] = True # expose internal debug module to every actor allowing # for use of ``await tractor.breakpoint()`` kwargs.setdefault('rpc_module_paths', []).append('tractor._debug') + elif debug_mode: + raise RuntimeError("Debug mode is only supported for the `trio` backend!") main = partial(async_fn, *args)