mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 16:30:27 +08:00
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'):
This commit is contained in:
parent
08bcf51bb4
commit
d33df46f19
@ -495,6 +495,9 @@ def EndBuilding(target, program = None):
|
|||||||
CscopeDatabase(Projects)
|
CscopeDatabase(Projects)
|
||||||
|
|
||||||
def SrcRemove(src, remove):
|
def SrcRemove(src, remove):
|
||||||
|
if not src:
|
||||||
|
return
|
||||||
|
|
||||||
if type(src[0]) == type('str'):
|
if type(src[0]) == type('str'):
|
||||||
for item in src:
|
for item in src:
|
||||||
if os.path.basename(item) in remove:
|
if os.path.basename(item) in remove:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user