Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Firmware/fibre/python/fibre/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import platform
import threading
import asyncio
import fibre

def did_discover_device(device,
Expand Down Expand Up @@ -101,12 +102,12 @@ def launch_shell(args,
interact = lambda: console.interact(banner='')

# install hook to hide ChannelBrokenException
console.runcode('import sys')
console.runcode('superexcepthook = sys.excepthook')
console.runcode('def newexcepthook(ex_class,ex,trace):\n'
asyncio.run(console.runcode('import sys'))
asyncio.run(console.runcode('superexcepthook = sys.excepthook'))
asyncio.run(console.runcode('def newexcepthook(ex_class,ex,trace):\n'
' if ex_class.__module__ + "." + ex_class.__name__ != "fibre.ChannelBrokenException":\n'
' superexcepthook(ex_class,ex,trace)')
console.runcode('sys.excepthook=newexcepthook')
' superexcepthook(ex_class,ex,trace)'))
asyncio.run(console.runcode('sys.excepthook=newexcepthook'))


# Launch shell
Expand Down