Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Only decode if we know we have bytes
Browse files Browse the repository at this point in the history
In python 3, `unicode` is the default string type.
  • Loading branch information
mat8913 committed Mar 31, 2020
1 parent 5d2c529 commit 043464d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fah/ClientConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ def log_add_lines(self, app, lines):

if len(filtered):
text = '\n'.join(filtered)
text = text.decode('utf-8', 'ignore')
if isinstance(text, bytes):
text = text.decode('utf-8', 'ignore')
app.log.insert(app.log.get_end_iter(), text + '\n')
self.scroll_log_to_end(app)

Expand Down

0 comments on commit 043464d

Please sign in to comment.