浏览代码

Don't handle BaseException in build scripts

Marcel Admiraal 4 年之前
父节点
当前提交
e21adf2bc6
共有 6 个文件被更改,包括 7 次插入7 次删除
  1. 2 2
      SConstruct
  2. 1 1
      core/SCsub
  3. 1 1
      methods.py
  4. 1 1
      modules/webm/libvpx/SCsub
  5. 1 1
      platform/android/detect.py
  6. 1 1
      platform/windows/detect.py

+ 2 - 2
SConstruct

@@ -484,13 +484,13 @@ if selected_platform in platform_list:
                 doc_path = config.get_doc_path()
                 doc_path = config.get_doc_path()
                 for c in doc_classes:
                 for c in doc_classes:
                     env.doc_class_path[c] = path + "/" + doc_path
                     env.doc_class_path[c] = path + "/" + doc_path
-            except:
+            except Exception:
                 pass
                 pass
             # Get icon paths (if present)
             # Get icon paths (if present)
             try:
             try:
                 icons_path = config.get_icons_path()
                 icons_path = config.get_icons_path()
                 env.module_icons_paths.append(path + "/" + icons_path)
                 env.module_icons_paths.append(path + "/" + icons_path)
-            except:
+            except Exception:
                 # Default path for module icons
                 # Default path for module icons
                 env.module_icons_paths.append(path + "/" + "icons")
                 env.module_icons_paths.append(path + "/" + "icons")
             modules_enabled[name] = path
             modules_enabled[name] = path

+ 1 - 1
core/SCsub

@@ -27,7 +27,7 @@ if "SCRIPT_AES256_ENCRYPTION_KEY" in os.environ:
             txts = "0x" + e[i * 2 : i * 2 + 2]
             txts = "0x" + e[i * 2 : i * 2 + 2]
             try:
             try:
                 int(txts, 16)
                 int(txts, 16)
-            except:
+            except Exception:
                 ec_valid = False
                 ec_valid = False
             txt += txts
             txt += txts
     if not ec_valid:
     if not ec_valid:

+ 1 - 1
methods.py

@@ -885,7 +885,7 @@ def show_progress(env):
     try:
     try:
         with open(node_count_data["fname"]) as f:
         with open(node_count_data["fname"]) as f:
             node_count_data["max"] = int(f.readline())
             node_count_data["max"] = int(f.readline())
-    except:
+    except Exception:
         pass
         pass
 
 
     cache_directory = os.environ.get("SCONS_CACHE")
     cache_directory = os.environ.get("SCONS_CACHE")

+ 1 - 1
modules/webm/libvpx/SCsub

@@ -270,7 +270,7 @@ if webm_cpu_x86:
         try:
         try:
             yasm_found = True
             yasm_found = True
             subprocess.Popen([yasm_path, "--version"], stdout=devnull, stderr=devnull).communicate()
             subprocess.Popen([yasm_path, "--version"], stdout=devnull, stderr=devnull).communicate()
-        except:
+        except Exception:
             yasm_found = False
             yasm_found = False
         if yasm_found:
         if yasm_found:
             break
             break

+ 1 - 1
platform/android/detect.py

@@ -329,6 +329,6 @@ def get_ndk_version(path):
                 key_value = list(map(lambda x: x.strip(), line.split("=")))
                 key_value = list(map(lambda x: x.strip(), line.split("=")))
                 if key_value[0] == "Pkg.Revision":
                 if key_value[0] == "Pkg.Revision":
                     return key_value[1]
                     return key_value[1]
-    except:
+    except Exception:
         print("Could not read source prop file '%s'" % prop_file_path)
         print("Could not read source prop file '%s'" % prop_file_path)
     return None
     return None

+ 1 - 1
platform/windows/detect.py

@@ -94,7 +94,7 @@ def build_res_file(target, source, env):
             out = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE).communicate()
             out = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE).communicate()
             if len(out[1]):
             if len(out[1]):
                 return 1
                 return 1
-        except:
+        except Exception:
             return 1
             return 1
     return 0
     return 0