Cleanup: replace implicit BaseException with Exception
Exception is more appropriate as a general exception in these cases.
This commit is contained in:
@@ -402,7 +402,7 @@ def main():
|
||||
log.info(" saving to: " + Path_Blend)
|
||||
try:
|
||||
bpy.ops.wm.save_as_mainfile(filepath=Path_Blend, copy=True, compress=False)
|
||||
except:
|
||||
except Exception:
|
||||
log.error("Filename {0} does not exist and can't be created... quitting".format(Path_Blend))
|
||||
return
|
||||
else:
|
||||
|
||||
@@ -2537,7 +2537,7 @@ def main():
|
||||
|
||||
try:
|
||||
os.mkdir(SPHINX_IN_TMP)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Copy extra files needed for theme.
|
||||
|
||||
@@ -166,7 +166,7 @@ def _fake_module(mod_name, mod_path, speedy=True):
|
||||
mod.bl_info = ast.literal_eval(body.value)
|
||||
mod.__file__ = mod_path
|
||||
mod.__time__ = os.path.getmtime(mod_path)
|
||||
except:
|
||||
except Exception:
|
||||
print("AST error parsing bl_info for:", repr(mod_path))
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -81,14 +81,14 @@ class DataPathBuilder:
|
||||
# print("base." + item_new)
|
||||
base_new = eval("base." + item_new)
|
||||
break # found, don't keep looking
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
item_new = "." + item_new
|
||||
else:
|
||||
item_new = item
|
||||
try:
|
||||
base_new = eval("base" + item_new)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if base_new is Ellipsis:
|
||||
|
||||
@@ -111,7 +111,7 @@ class AppOverrideState:
|
||||
# (someone else was changing the sys.path), ignore!
|
||||
try:
|
||||
sys.path.remove(path)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
addons = self._addon_store["addons"]
|
||||
|
||||
@@ -138,7 +138,7 @@ def _test_import(module_name, loaded_modules):
|
||||
|
||||
try:
|
||||
mod = __import__(module_name)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return None
|
||||
@@ -236,7 +236,7 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False, extensions=True
|
||||
if register:
|
||||
try:
|
||||
register()
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
else:
|
||||
@@ -250,7 +250,7 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False, extensions=True
|
||||
if unregister:
|
||||
try:
|
||||
unregister()
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -264,7 +264,7 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False, extensions=True
|
||||
|
||||
try:
|
||||
return importlib.reload(mod)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -817,7 +817,7 @@ def keyconfig_set(filepath, *, report=None):
|
||||
try:
|
||||
error_msg = ""
|
||||
execfile(filepath)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
error_msg = traceback.format_exc()
|
||||
|
||||
@@ -864,7 +864,7 @@ def user_resource(resource_type, *, path="", create=False):
|
||||
if not _os.path.exists(target_path):
|
||||
try:
|
||||
_os.makedirs(target_path)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
target_path = ""
|
||||
@@ -913,7 +913,7 @@ def extension_path_user(package, *, path="", create=False):
|
||||
if not _os.path.exists(target_path):
|
||||
try:
|
||||
_os.makedirs(target_path)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
target_path = ""
|
||||
@@ -1219,7 +1219,7 @@ def manual_map():
|
||||
for cb in reversed(_manual_map):
|
||||
try:
|
||||
prefix, url_manual_mapping = cb()
|
||||
except:
|
||||
except Exception:
|
||||
print("Error calling {!r}".format(cb))
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -548,13 +548,13 @@ def path_reference_copy(copy_set, report=print):
|
||||
|
||||
try:
|
||||
os.makedirs(dir_to, exist_ok=True)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
try:
|
||||
shutil.copy(file_src, file_dst)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
@@ -1035,7 +1035,7 @@ class _GenericUI:
|
||||
# the entire menu from drawing
|
||||
try:
|
||||
func(self, context)
|
||||
except:
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ def build_property_typemap(skip_classes, skip_typemap):
|
||||
for prop_id in properties_blacklist:
|
||||
try:
|
||||
properties.remove(prop_id)
|
||||
except:
|
||||
except Exception:
|
||||
print("skip_typemap unknown prop_id '{:s}.{:s}'".format(cls_name, prop_id))
|
||||
else:
|
||||
print("skip_typemap unknown class '{:s}'".format(cls_name))
|
||||
@@ -130,7 +130,7 @@ def rna2xml(
|
||||
else:
|
||||
try:
|
||||
subvalue_ls = list(subvalue)
|
||||
except:
|
||||
except Exception:
|
||||
subvalue_ls = None
|
||||
|
||||
if subvalue_ls is None:
|
||||
@@ -213,7 +213,7 @@ def rna2xml(
|
||||
value = getattr(root_rna, attr)
|
||||
try:
|
||||
ls = value[:]
|
||||
except:
|
||||
except Exception:
|
||||
ls = None
|
||||
|
||||
if type(ls) == list:
|
||||
|
||||
@@ -58,7 +58,7 @@ def seek(r, txt, recurs):
|
||||
|
||||
try:
|
||||
keys = r.keys()
|
||||
except:
|
||||
except Exception:
|
||||
keys = None
|
||||
|
||||
if keys is not None:
|
||||
@@ -67,7 +67,7 @@ def seek(r, txt, recurs):
|
||||
|
||||
try:
|
||||
__members__ = dir(r)
|
||||
except:
|
||||
except Exception:
|
||||
__members__ = []
|
||||
|
||||
for item in __members__:
|
||||
@@ -93,7 +93,7 @@ def seek(r, txt, recurs):
|
||||
else:
|
||||
try:
|
||||
length = len(r)
|
||||
except:
|
||||
except Exception:
|
||||
length = 0
|
||||
|
||||
if VERBOSE is False and length >= 4:
|
||||
|
||||
Reference in New Issue
Block a user