Skip to content

Commit f130866

Browse files
author
zhangbin
committed
Solve the crash problem of cocos console on some Mac machines.
1 parent ad5b9df commit f130866

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/cocos.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,14 @@ def _check_python_version():
932932
return ret
933933

934934
# gettext
935-
locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
936-
language, encoding = locale.getlocale()
935+
language = None
936+
encoding = None
937+
try:
938+
locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
939+
language, encoding = locale.getlocale()
940+
except:
941+
pass
942+
937943
if language is not None:
938944
filename = "language_%s.mo" % language[0:2]
939945
try:

0 commit comments

Comments
 (0)