mirror of
https://github.com/W1NDes/M-AzurLaneAutoScript.git
synced 2026-05-14 07:08:04 +08:00
Fix: Encoding error
This commit is contained in:
parent
a988083689
commit
e1337158b7
@ -1,3 +1,4 @@
|
||||
import codecs
|
||||
import datetime
|
||||
import logging
|
||||
import os
|
||||
@ -15,6 +16,14 @@ from rich.style import Style
|
||||
from rich.theme import Theme
|
||||
from rich.traceback import Traceback
|
||||
|
||||
try:
|
||||
if sys.stdout.encoding.lower() != 'utf-8':
|
||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
|
||||
if sys.stderr.encoding.lower() != 'utf-8':
|
||||
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def empty_function(*args, **kwargs):
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user