浏览代码

[skip ci] Fix the rsplit issue in Linux

Bernard Xiong 6 年之前
父节点
当前提交
240451b978
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      tools/utils.py

+ 7 - 4
tools/utils.py

@@ -114,11 +114,14 @@ def walk_children(child):
 
 
     # print child
     # print child
     full_path = child.rfile().abspath
     full_path = child.rfile().abspath
-    file_type  = full_path.rsplit('.',1)[1]
+    file_type_list  = full_path.rsplit('.',1)
     #print file_type
     #print file_type
-    if file_type in source_ext:
-        if full_path not in source_list:
-            source_list.append(full_path)
+    if (len(file_type_list) > 1):
+        file_type = full_path.rsplit('.',1)[1]
+
+        if file_type in source_ext:
+            if full_path not in source_list:
+                source_list.append(full_path)
 
 
     children = child.all_children()
     children = child.all_children()
     if children != []:
     if children != []: