mirror of
https://github.com/markqvist/rnsh.git
synced 2024-10-01 01:15:37 -04:00
Fix logging throws if event loop is set but not running
This commit is contained in:
parent
c7c75d5ea4
commit
f80823344b
@ -122,9 +122,12 @@ def _rns_log(msg, level=3, _override_destination=False):
|
||||
if tattr_orig is not None:
|
||||
termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, tattr_orig)
|
||||
|
||||
if _loop:
|
||||
_loop.call_soon_threadsafe(inner)
|
||||
else:
|
||||
try:
|
||||
if _loop:
|
||||
_loop.call_soon_threadsafe(inner)
|
||||
else:
|
||||
inner()
|
||||
except RuntimeError:
|
||||
inner()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user