提交 4d2972a8 编写于 作者: G Grissiom

tools: fix SrcRemove on empty src

If the src is empty list, it will crash at:

    IndexError: list index out of range:
      File "/home/xxx/src/SConstruct", line 39:
        objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=True)
      ...
      File "/home/xxx/src/drivers/SConscript", line 12:
        SrcRemove(src, src_need_remove)
      File "/home/rt-thread-stable/tools/building.py", line 496:
        if type(src[0]) == type('str'):

Commit d33df46f in master.
上级 8b8d69f6
......@@ -493,6 +493,9 @@ def EndBuilding(target, program = None):
CscopeDatabase(Projects)
def SrcRemove(src, remove):
if not src:
return
if type(src[0]) == type('str'):
for item in src:
if os.path.basename(item) in remove:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册