diff --git a/tractor/devx/debug/_trace.py b/tractor/devx/debug/_trace.py index dc31fa92..970e127f 100644 --- a/tractor/devx/debug/_trace.py +++ b/tractor/devx/debug/_trace.py @@ -285,7 +285,7 @@ async def _pause( # the `PdbREPL`. repl_task: Thread|Task|None = DebugStatus.repl_task if ( - not DebugStatus.repl_release + DebugStatus.repl_release is None or DebugStatus.repl_release.is_set() ): @@ -849,7 +849,7 @@ async def _pause_from_bg_root_thread( stats: trio.LockStatistics= lock.statistics() assert stats.owner is task assert Lock._owned_by_root - assert DebugStatus.repl_release + assert DebugStatus.repl_release is not None # TODO: do we actually need this? # originally i was trying to solve wy this was diff --git a/tractor/devx/debug/_tty_lock.py b/tractor/devx/debug/_tty_lock.py index eae8c533..781a6cb8 100644 --- a/tractor/devx/debug/_tty_lock.py +++ b/tractor/devx/debug/_tty_lock.py @@ -172,7 +172,7 @@ class Lock: f'|_ .ctx_in_debug: {cls.ctx_in_debug}\n' f'|_ .req_handler_finished: {req}\n' ) - if req: + if req is not None: req_stats: trio.EventStatistics = req.statistics() fields += f' {req_stats}\n' @@ -288,7 +288,8 @@ class Lock: ) elif ( - req_handler_finished # new IPC ctx debug request active + # new IPC ctx debug request active + req_handler_finished is not None and lock.locked() # someone has the lock ): diff --git a/tractor/runtime/_rpc.py b/tractor/runtime/_rpc.py index 2f60c17b..e72ee1cf 100644 --- a/tractor/runtime/_rpc.py +++ b/tractor/runtime/_rpc.py @@ -1137,7 +1137,7 @@ async def process_messages( # runtime cancellation if this actor is # currently in debug mode! pdb_complete: trio.Event|None = debug.DebugStatus.repl_release - if pdb_complete: + if pdb_complete is not None: await pdb_complete.wait() # Either of `Actor.cancel()`/`.cancel_soon()`