提交 d1c66d0e 编写于 作者: mysterywolf's avatar mysterywolf 提交者: mysterywolf

[tools][iar] 将IARPath作为独立函数

上级 dc6b9fde
...@@ -169,26 +169,26 @@ def IARProject(target, script): ...@@ -169,26 +169,26 @@ def IARProject(target, script):
IARWorkspace(target) IARWorkspace(target)
def IARVersion(): def IARPath():
import subprocess import rtconfig
import re
def IARPath(): # backup environ
import rtconfig old_environ = os.environ
os.environ['RTT_CC'] = 'iar'
utils.ReloadModule(rtconfig)
# backup environ # get iar path
old_environ = os.environ path = rtconfig.EXEC_PATH
os.environ['RTT_CC'] = 'iar'
utils.ReloadModule(rtconfig)
# get iar path # restore environ
path = rtconfig.EXEC_PATH os.environ = old_environ
utils.ReloadModule(rtconfig)
# restore environ return path
os.environ = old_environ
utils.ReloadModule(rtconfig)
return path def IARVersion():
import subprocess
import re
path = IARPath() path = IARPath()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册