Skip to content

Commit

Permalink
Ignore greenback import error if not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Oct 19, 2023
1 parent 9da3b63 commit 2f0bed3
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions tractor/devx/_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,22 +836,25 @@ async def pause(
# runtime aware version which takes care of all .
def pause_from_sync() -> None:
print("ENTER SYNC PAUSE")
import greenback
__tracebackhide__ = True

actor: tractor.Actor = tractor.current_actor()
# task_can_release_tty_lock = trio.Event()

# spawn bg task which will lock out the TTY, we poll
# just below until the release event is reporting that task as
# waiting.. not the most ideal but works for now ;)
greenback.await_(
actor._service_n.start(partial(
pause,
debug_func=None,
# release_lock_signal=task_can_release_tty_lock,
))
)
try:
import greenback
__tracebackhide__ = True

actor: tractor.Actor = tractor.current_actor()
# task_can_release_tty_lock = trio.Event()

# spawn bg task which will lock out the TTY, we poll
# just below until the release event is reporting that task as
# waiting.. not the most ideal but works for now ;)
greenback.await_(
actor._service_n.start(partial(
pause,
debug_func=None,
# release_lock_signal=task_can_release_tty_lock,
))
)
except ModuleNotFoundError:
log.warning('NO GREENBACK FOUND')

db, undo_sigint = mk_mpdb()
Lock.local_task_in_debug = 'sync'
Expand Down

0 comments on commit 2f0bed3

Please sign in to comment.