diff --git a/main.py b/main.py index 9bfdf10..6655a62 100755 --- a/main.py +++ b/main.py @@ -45,7 +45,7 @@ def ReportError(script, e): # When the encoding of stderr is unknown (e.g. when redirected to a file), # output will be encoded in UTF-8; otherwise the terminal's encoding will # be used. - enc = getattr(sys.stderr, 'encoding', 'utf8') + enc = getattr(sys.stderr, 'encoding', 'utf8') or 'utf8' # Synchronize the UTF-8 encoded line with the output line in the # terminal's encoding. We need to compensate for the fact that the