mirror of
https://github.com/markqvist/rnsh.git
synced 2025-05-02 14:26:33 -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,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…
Add table
Add a link
Reference in a new issue