mirror of
https://github.com/markqvist/rnsh.git
synced 2025-03-10 17:39:17 -04:00
Fix exceptions when using -p option
This commit is contained in:
parent
0b7fd9cedd
commit
5860317743
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "rnsh"
|
name = "rnsh"
|
||||||
version = "0.0.1"
|
version = "0.0.2"
|
||||||
description = "Shell over Reticulum"
|
description = "Shell over Reticulum"
|
||||||
authors = ["acehoss <acehoss@acehoss.net>"]
|
authors = ["acehoss <acehoss@acehoss.net>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -107,13 +107,15 @@ def _rns_log(msg, level=3, _override_destination=False):
|
|||||||
|
|
||||||
def _rns_log_inner():
|
def _rns_log_inner():
|
||||||
nonlocal msg, level, _override_destination
|
nonlocal msg, level, _override_destination
|
||||||
with process.TTYRestorer(sys.stdin.fileno()) as tr:
|
try:
|
||||||
with exception.permit(SystemExit):
|
with process.TTYRestorer(sys.stdin.fileno()) as tr:
|
||||||
attr = tr.current_attr()
|
attr = tr.current_attr()
|
||||||
attr[process.TTYRestorer.ATTR_IDX_OFLAG] = attr[process.TTYRestorer.ATTR_IDX_OFLAG] | \
|
attr[process.TTYRestorer.ATTR_IDX_OFLAG] = attr[process.TTYRestorer.ATTR_IDX_OFLAG] | \
|
||||||
termios.ONLRET | termios.ONLCR | termios.OPOST
|
termios.ONLRET | termios.ONLCR | termios.OPOST
|
||||||
tr.set_attr(attr)
|
tr.set_attr(attr)
|
||||||
_rns_log_orig(msg, level, _override_destination)
|
_rns_log_orig(msg, level, _override_destination)
|
||||||
|
except ValueError:
|
||||||
|
_rns_log_orig(msg, level, _override_destination)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if _loop:
|
if _loop:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user