1
0
Эх сурвалжийг харах

update SrcRemove(): auto detect string or file object.

aozima 7 жил өмнө
parent
commit
a1902f2de0
1 өөрчлөгдсөн 5 нэмэгдсэн , 7 устгасан
  1. 5 7
      tools/building.py

+ 5 - 7
tools/building.py

@@ -695,15 +695,13 @@ def SrcRemove(src, remove):
     if not src:
         return
 
-    if type(src[0]) == type('str'):
-        for item in src:
+    for item in src:
+        if type(item) == type('str'):
             if os.path.basename(item) in remove:
                 src.remove(item)
-        return
-
-    for item in src:
-        if os.path.basename(item.rstr()) in remove:
-            src.remove(item)
+        else:
+            if os.path.basename(item.rstr()) in remove:
+                src.remove(item)
 
 def GetVersion():
     import SCons.cpp