Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-04 15:13:06 +0200
committerAnton Hvornum <anton@hvornum.se>2021-04-04 15:13:06 +0200
commit81822e64443e4e43554ae4f891dfc8af79ea48d5 (patch)
tree55370260edf8b90070740a41053d1623a8a866be /archinstall/lib/general.py
parent2f6a71756a06b6feff3acdad3a3d8490e7504ab7 (diff)
Added error handling to sys_command's peak function.
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index ded2c5a3..41a83651 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -159,10 +159,16 @@ class sys_command():#Thread):
'exit_code': self.exit_code
}
- def peak(self, output):
+ def peak(self, output :str):
+ if type(output) == bytes:
+ try:
+ output = output.decode('UTF-8')
+ except UnicodeDecodeError:
+ return None
+
if self.peak_output:
from .user_interaction import get_terminal_width
-
+
# Move back to the beginning of the terminal
sys.stdout.flush()
sys.stdout.write("\033[%dG" % 0)