mirror of
https://github.com/markqvist/rnsh.git
synced 2025-06-29 00:07:07 -04:00
Fix logging throws if event loop is set but not running
This commit is contained in:
parent
c7c75d5ea4
commit
f80823344b
1 changed files with 6 additions and 3 deletions
|
@ -122,10 +122,13 @@ def _rns_log(msg, level=3, _override_destination=False):
|
||||||
if tattr_orig is not None:
|
if tattr_orig is not None:
|
||||||
termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, tattr_orig)
|
termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, tattr_orig)
|
||||||
|
|
||||||
|
try:
|
||||||
if _loop:
|
if _loop:
|
||||||
_loop.call_soon_threadsafe(inner)
|
_loop.call_soon_threadsafe(inner)
|
||||||
else:
|
else:
|
||||||
inner()
|
inner()
|
||||||
|
except RuntimeError:
|
||||||
|
inner()
|
||||||
|
|
||||||
|
|
||||||
RNS.log = _rns_log
|
RNS.log = _rns_log
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue