1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 08:38:20 +08:00

Fix: Unable to run in pythonw.exe

This commit is contained in:
LmeSzinc
2020-06-24 10:49:27 +08:00
parent b4a72d9be7
commit fad4902708
3 changed files with 24 additions and 12 deletions

View File

@@ -9,10 +9,14 @@ from module.config.dictionary import dic_true_eng_to_eng, dic_eng_to_true_eng
from module.config.update import get_config
from module.logger import pyw_name
if sys.stdout.encoding != 'UTF-8':
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
if sys.stderr.encoding != 'UTF-8':
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
try:
if sys.stdout.encoding != 'UTF-8':
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
if sys.stderr.encoding != 'UTF-8':
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
except Exception:
pass
@Gooey(