mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 07:38:21 +00:00
The encoding of sys.stderr can exist and be None.
This commit is contained in:
parent
2c94905f1e
commit
3cfbbb923c
1 changed files with 1 additions and 1 deletions
2
main.py
2
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue