Skip to content

Commit 85dee52

Browse files
committed
【修改】:检测 rt-thread 是否被存放在非 ascii 路径中
1 parent 9c87057 commit 85dee52

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

env.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# Change Logs:
2222
# Date Author Notes
2323
# 2018-5-28 SummerGift Add copyright information
24+
# 2019-1-16 SummerGift Add chinese detection
2425
#
2526

2627
import os
@@ -31,7 +32,7 @@
3132
from cmds import *
3233
from vars import Export
3334

34-
__version__ = 'rt-thread packages v1.0.0'
35+
__version__ = 'rt-thread packages v1.1.0'
3536

3637

3738
def init_argparse():
@@ -63,6 +64,20 @@ def main():
6364
Export('env_root')
6465
Export('bsp_root')
6566

67+
try:
68+
bsp_root.decode("ascii")
69+
except Exception, e:
70+
if platform.system() == "Windows":
71+
os.system('chcp 65001 > nul')
72+
73+
print ("rt-thread 必须被放置在纯英文目录下,请移动 rt-thread 到纯英文目录中。")
74+
print ("rt-thread must be placed in a pure English directory, please move rt-thread to a pure English directory.")
75+
76+
if platform.system() == "Windows":
77+
os.system('chcp 437 > nul')
78+
79+
return False
80+
6681
parser = init_argparse()
6782
args = parser.parse_args()
6883
args.func(args)

0 commit comments

Comments
 (0)