mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-29 16:17:13 +08:00
Fix: Unable to run in pythonw.exe
This commit is contained in:
@@ -10,10 +10,14 @@ from module.config.dictionary import dic_chi_to_eng, dic_eng_to_chi
|
|||||||
from module.config.update import get_config
|
from module.config.update import get_config
|
||||||
from module.logger import pyw_name
|
from module.logger import pyw_name
|
||||||
|
|
||||||
if sys.stdout.encoding != 'UTF-8':
|
|
||||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
|
try:
|
||||||
if sys.stderr.encoding != 'UTF-8':
|
if sys.stdout.encoding != 'UTF-8':
|
||||||
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
|
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(
|
@Gooey(
|
||||||
|
|||||||
@@ -10,10 +10,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.config.update import get_config
|
||||||
from module.logger import pyw_name
|
from module.logger import pyw_name
|
||||||
|
|
||||||
if sys.stdout.encoding != 'UTF-8':
|
|
||||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
|
try:
|
||||||
if sys.stderr.encoding != 'UTF-8':
|
if sys.stdout.encoding != 'UTF-8':
|
||||||
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
|
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(
|
@Gooey(
|
||||||
|
|||||||
@@ -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.config.update import get_config
|
||||||
from module.logger import pyw_name
|
from module.logger import pyw_name
|
||||||
|
|
||||||
if sys.stdout.encoding != 'UTF-8':
|
|
||||||
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
|
try:
|
||||||
if sys.stderr.encoding != 'UTF-8':
|
if sys.stdout.encoding != 'UTF-8':
|
||||||
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
|
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(
|
@Gooey(
|
||||||
|
|||||||
Reference in New Issue
Block a user