Skip to content

Commit

Permalink
better decode in output
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 14, 2019
1 parent 8790ae9 commit d8f702e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ogs5py/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def close(self):

def write(self, data):
"""Write data to both channels."""
self.last_line = data.decode(self.encoding)
try:
self.last_line = data.decode(self.encoding)
except AttributeError:
self.last_line = data
self.file.write(self.last_line)
if self.print_log:
sys.stdout.write(self.last_line)
Expand Down

0 comments on commit d8f702e

Please sign in to comment.