summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2014-10-08 17:53:26 +0800
committerGrissiom <[email protected]>2014-10-08 18:03:12 +0800
commitd33df46f1921f241199e7520e384e851840571ef (patch)
tree98ad53e3ef1b702407a0f68d940698ab7eb887b1
parent08bcf51bb46e3f615e15e675b5b0ca6380dabd54 (diff)
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'):
-rw-r--r--tools/building.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/building.py b/tools/building.py
index 24f661de88..79e6fd1a4b 100644
--- a/tools/building.py
+++ b/tools/building.py
@@ -495,6 +495,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: