diff --git a/scripts/modules/_bpy_internal/freedesktop.py b/scripts/modules/_bpy_internal/freedesktop.py index a9bd956ea8c..70aa34e60a8 100644 --- a/scripts/modules/_bpy_internal/freedesktop.py +++ b/scripts/modules/_bpy_internal/freedesktop.py @@ -453,7 +453,7 @@ def call_handle_checked( ) -> Optional[str]: try: result = fn(do_register, all_users) - except BaseException as ex: + except Exception as ex: # This should never happen. result = "Internal Error: {!r}".format(ex) return result diff --git a/scripts/modules/addon_utils.py b/scripts/modules/addon_utils.py index fa8227ad71e..58f99e9903e 100644 --- a/scripts/modules/addon_utils.py +++ b/scripts/modules/addon_utils.py @@ -144,7 +144,7 @@ def _fake_module(mod_name, mod_path, speedy=True): try: ast_data = ast.parse(data, filename=mod_path) - except BaseException: + except Exception: print("Syntax error 'ast.parse' can't read:", repr(mod_path)) import traceback traceback.print_exc() @@ -369,7 +369,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non # in most cases the caller should 'check()' first. try: mod.unregister() - except BaseException as ex: + except Exception as ex: print("Exception in module unregister():", (mod_file or module_name)) handle_error(ex) return None @@ -382,7 +382,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non try: importlib.reload(mod) - except BaseException as ex: + except Exception as ex: handle_error(ex) del sys.modules[module_name] return None @@ -420,7 +420,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non ) mod.__time__ = os.path.getmtime(mod_file) mod.__addon_enabled__ = False - except BaseException as ex: + except Exception as ex: # If the add-on doesn't exist, don't print full trace-back because the back-trace is in this case # is verbose without any useful details. A missing path is better communicated in a short message. # Account for `ImportError` & `ModuleNotFoundError`. @@ -486,7 +486,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non # 3) Try run the modules register function. try: mod.register() - except BaseException as ex: + except Exception as ex: print("Exception in module register():", (mod_file or module_name)) handle_error(ex) del sys.modules[module_name] @@ -535,7 +535,7 @@ def disable(module_name, *, default_set=False, handle_error=None): try: mod.unregister() - except BaseException as ex: + except Exception as ex: mod_path = getattr(mod, "__file__", module_name) print("Exception in module unregister():", repr(mod_path)) del mod_path @@ -1201,7 +1201,7 @@ def _bl_info_from_extension(mod_name, mod_path): except FileNotFoundError: print("Warning: add-on missing manifest, this can cause poor performance!:", repr(filepath_toml)) return None, filepath_toml - except BaseException as ex: + except Exception as ex: print("Error:", str(ex), "in", filepath_toml) return None, filepath_toml @@ -1225,7 +1225,7 @@ def _bl_info_from_extension(mod_name, mod_path): (int if i < 2 else _version_int_left_digits)(x) for i, x in enumerate(value.split(".", 2)) ) - except BaseException as ex: + except Exception as ex: print("Error: \"version\" is not a semantic version (X.Y.Z) in ", filepath_toml, str(ex)) return None, filepath_toml bl_info["version"] = value @@ -1238,7 +1238,7 @@ def _bl_info_from_extension(mod_name, mod_path): return None, filepath_toml try: value = tuple(int(x) for x in value.split(".")) - except BaseException as ex: + except Exception as ex: print("Error:", str(ex), "in \"blender_version_min\"", filepath_toml) return None, filepath_toml bl_info["blender"] = value @@ -1410,7 +1410,7 @@ def _extension_dirpath_from_handle(): # meddle with the modules. try: dirpath = module.__path__[0] - except BaseException: + except Exception: dirpath = "" repos_info[module_id] = dirpath return repos_info diff --git a/scripts/modules/bl_app_template_utils.py b/scripts/modules/bl_app_template_utils.py index f4bbf66f057..5d841106220 100644 --- a/scripts/modules/bl_app_template_utils.py +++ b/scripts/modules/bl_app_template_utils.py @@ -52,7 +52,7 @@ def _enable(template_id, *, handle_error=None, ignore_not_found=False): # 1) try import try: mod = import_from_id(template_id, ignore_not_found=ignore_not_found) - except BaseException as ex: + except Exception as ex: handle_error(ex) return None @@ -64,7 +64,7 @@ def _enable(template_id, *, handle_error=None, ignore_not_found=False): # 2) try run the modules register function try: mod.register() - except BaseException as ex: + except Exception as ex: print("Exception in module register(): {!r}".format(getattr(mod, "__file__", template_id))) handle_error(ex) del _modules[template_id] @@ -105,7 +105,7 @@ def _disable(template_id, *, handle_error=None): try: mod.unregister() - except BaseException as ex: + except Exception as ex: print("Exception in module unregister(): {!r}".format(getattr(mod, "__file__", template_id))) handle_error(ex) else: diff --git a/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/scripts/modules/bl_i18n_utils/bl_extract_messages.py index b47628c1d99..be151a27ed1 100644 --- a/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -29,7 +29,7 @@ def init_spell_check(settings, lang="en_US"): try: from bl_i18n_utils import utils_spell_check return utils_spell_check.SpellChecker(settings, lang) - except BaseException as ex: + except Exception as ex: print("Failed to import utils_spell_check ({})".format(str(ex))) return None @@ -574,7 +574,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): op = getattr(op, n) try: return op.get_rna_type().translation_context - except BaseException as ex: + except Exception as ex: default_op_context = i18n_contexts.operator_default print("ERROR: ", str(ex)) print(" Assuming default operator context '{}'".format(default_op_context)) diff --git a/scripts/modules/bl_i18n_utils/utils.py b/scripts/modules/bl_i18n_utils/utils.py index ab98ac84f95..02535efbc7a 100644 --- a/scripts/modules/bl_i18n_utils/utils.py +++ b/scripts/modules/bl_i18n_utils/utils.py @@ -239,7 +239,7 @@ def enable_addons(addons=None, support=None, disable=False, check_only=False): continue print(" Enabling module ", addon_module_name) bpy.ops.preferences.addon_enable(module=addon_module_name) - except BaseException as ex: # XXX TEMP WORKAROUND + except Exception as ex: # XXX TEMP WORKAROUND print(ex) # XXX There are currently some problems with bpy/rna... diff --git a/scripts/modules/bl_keymap_utils/io.py b/scripts/modules/bl_keymap_utils/io.py index 5abd1fc7995..e3339adae08 100644 --- a/scripts/modules/bl_keymap_utils/io.py +++ b/scripts/modules/bl_keymap_utils/io.py @@ -242,7 +242,7 @@ def _init_properties_from_data(base_props, base_value): setattr(base_props, attr, value) except AttributeError: print(f"Warning: property '{attr}' not found in item '{base_props.__class__.__name__}'") - except BaseException as ex: + except Exception as ex: print(f"Warning: {ex!r}") diff --git a/scripts/modules/bl_previews_utils/bl_previews_render.py b/scripts/modules/bl_previews_utils/bl_previews_render.py index 99bbabbe498..671dfafbc29 100644 --- a/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -152,7 +152,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): scene = None else: rna_backup_restore(scene, render_context.backup_scene) - except BaseException as ex: + except Exception as ex: print("ERROR:", ex) success = False @@ -166,7 +166,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): bpy.data.worlds.remove(world) else: rna_backup_restore(world, render_context.backup_world) - except BaseException as ex: + except Exception as ex: print("ERROR:", ex) success = False @@ -184,7 +184,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): rna_backup_restore(camera, render_context.backup_camera) rna_backup_restore(bpy.data.cameras[render_context.camera_data, None], render_context.backup_camera_data) - except BaseException as ex: + except Exception as ex: print("ERROR:", ex) success = False @@ -201,7 +201,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): rna_backup_restore(light, render_context.backup_light) rna_backup_restore(bpy.data.lights[render_context.light_data, None], render_context.backup_light_data) - except BaseException as ex: + except Exception as ex: print("ERROR:", ex) success = False @@ -209,7 +209,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): image = bpy.data.images[render_context.image, None] image.user_clear() bpy.data.images.remove(image) - except BaseException as ex: + except Exception as ex: print("ERROR:", ex) success = False @@ -424,7 +424,7 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern): print("Saving {:s}...".format(bpy.data.filepath)) try: bpy.ops.wm.save_mainfile() - except BaseException as ex: + except Exception as ex: # Might fail in some odd cases, like e.g. in regression files we have `glsl/ram_glsl.blend` which # references an nonexistent texture. Better not break in this case, just spit error to console. print("ERROR:", ex) diff --git a/scripts/modules/bl_text_utils/external_editor.py b/scripts/modules/bl_text_utils/external_editor.py index a89fc850070..06fffc0de81 100644 --- a/scripts/modules/bl_text_utils/external_editor.py +++ b/scripts/modules/bl_text_utils/external_editor.py @@ -42,13 +42,13 @@ def open_external_editor(filepath, line, column, /): try: args.extend([Template(arg).substitute(**template_vars) for arg in shlex.split(text_editor_args)]) - except BaseException as ex: + except Exception as ex: return rpt_("Exception parsing template: {!r}").format(ex) try: # With `check=True` if `process.returncode != 0` an exception will be raised. subprocess.run(args, check=True) - except BaseException as ex: + except Exception as ex: return rpt_("Exception running external editor: {!r}").format(ex) return "" diff --git a/scripts/modules/rna_keymap_ui.py b/scripts/modules/rna_keymap_ui.py index 9e50cf056e7..41f47be2822 100644 --- a/scripts/modules/rna_keymap_ui.py +++ b/scripts/modules/rna_keymap_ui.py @@ -439,7 +439,7 @@ def draw_keymaps(context, layout): # Defined by user preset, may contain mistakes out of our control. try: kc_prefs.draw(box) - except BaseException: + except Exception: import traceback traceback.print_exc() del box diff --git a/scripts/modules/rna_xml.py b/scripts/modules/rna_xml.py index 6c30a8d8a55..e24cc5efe2e 100644 --- a/scripts/modules/rna_xml.py +++ b/scripts/modules/rna_xml.py @@ -366,7 +366,7 @@ def xml2rna( def _get_context_val(context, path): try: value = context.path_resolve(path) - except BaseException as ex: + except Exception as ex: print("Error: {!r}, path {!r} not found".format(ex, path)) value = Ellipsis diff --git a/scripts/startup/bl_operators/anim.py b/scripts/startup/bl_operators/anim.py index 25582a0a31c..0c65ca80d8d 100644 --- a/scripts/startup/bl_operators/anim.py +++ b/scripts/startup/bl_operators/anim.py @@ -413,7 +413,7 @@ class UpdateAnimatedTransformConstraint(Operator): data = ... try: data = eval("base." + old_path) - except BaseException: + except Exception: pass ret = (data, old_path) if isinstance(base, bpy.types.TransformConstraint) and data is not ...: @@ -430,7 +430,7 @@ class UpdateAnimatedTransformConstraint(Operator): data = ... try: data = eval("base." + new_path) - except BaseException: + except Exception: pass ret = (data, new_path) # print(ret) diff --git a/scripts/startup/bl_operators/image.py b/scripts/startup/bl_operators/image.py index e5ef22957be..2df66975169 100644 --- a/scripts/startup/bl_operators/image.py +++ b/scripts/startup/bl_operators/image.py @@ -72,7 +72,7 @@ class EditExternally(Operator): try: subprocess.Popen(cmd) - except BaseException: + except Exception: import traceback traceback.print_exc() self.report( diff --git a/scripts/startup/bl_operators/object.py b/scripts/startup/bl_operators/object.py index 1117573fc56..cee7901fb2e 100644 --- a/scripts/startup/bl_operators/object.py +++ b/scripts/startup/bl_operators/object.py @@ -286,7 +286,7 @@ class SubdivisionSet(Operator): else: mod = obj.modifiers.new("Subdivision", 'SUBSURF') mod.levels = level - except BaseException: + except Exception: self.report({'WARNING'}, "Modifiers cannot be added to object: " + obj.name) for obj in context.selected_editable_objects: diff --git a/scripts/startup/bl_operators/object_quick_effects.py b/scripts/startup/bl_operators/object_quick_effects.py index b717e6daed6..cdfde38ca97 100644 --- a/scripts/startup/bl_operators/object_quick_effects.py +++ b/scripts/startup/bl_operators/object_quick_effects.py @@ -189,7 +189,7 @@ class QuickFur(ObjectModeOperator, Operator): with context.temp_override(object=curves_object): try: bpy.ops.object.modifier_apply(modifier=generate_modifier.name) - except BaseException: + except Exception: modifier_apply_error = True curves_object.modifiers.move(0, len(curves_object.modifiers) - 1) diff --git a/scripts/startup/bl_operators/presets.py b/scripts/startup/bl_operators/presets.py index 6f7daa94785..1b5b38905db 100644 --- a/scripts/startup/bl_operators/presets.py +++ b/scripts/startup/bl_operators/presets.py @@ -53,7 +53,7 @@ def _call_preset_cb(fn, context, filepath, *, deprecated="4.2"): try: fn(*args) - except BaseException as ex: + except Exception as ex: print("Internal error running", fn, str(ex)) @@ -185,7 +185,7 @@ class AddPresetBase: # to simple lists to repr() try: value = value[:] - except BaseException: + except Exception: pass file_preset.write("{:s} = {!r}\n".format(rna_path_step, value)) @@ -230,7 +230,7 @@ class AddPresetBase: self.remove(context, filepath) else: os.remove(filepath) - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, rpt_("Unable to remove preset: {!r}").format(ex)) import traceback traceback.print_exc() @@ -288,7 +288,7 @@ class ExecutePreset(Operator): if ext == ".py": try: bpy.utils.execfile(filepath) - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, "Failed to execute the preset: " + repr(ex)) elif ext == ".xml": @@ -691,7 +691,7 @@ class SavePresetInterfaceTheme(AddPresetBase, Operator): preset_menu_class = getattr(bpy.types, self.preset_menu) try: rna_xml.xml_file_write(context, filepath, preset_menu_class.preset_xml_map) - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, "Unable to overwrite preset: {:s}".format(str(ex))) import traceback traceback.print_exc() diff --git a/scripts/startup/bl_operators/screen_play_rendered_anim.py b/scripts/startup/bl_operators/screen_play_rendered_anim.py index 6192d32d76e..228e077635a 100644 --- a/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -194,7 +194,7 @@ class PlayRenderedAnim(Operator): try: subprocess.Popen(cmd) - except BaseException as ex: + except Exception as ex: err_msg = rpt_("Couldn't run external animation player with command {!r}\n{:s}").format(cmd, str(ex)) self.report( {'ERROR'}, diff --git a/scripts/startup/bl_operators/sequencer.py b/scripts/startup/bl_operators/sequencer.py index 9ba430808a2..5e3d656d2c7 100644 --- a/scripts/startup/bl_operators/sequencer.py +++ b/scripts/startup/bl_operators/sequencer.py @@ -311,7 +311,7 @@ class SequencerFadesAdd(Operator): try: if fade.start.x < keyframe.co[0] <= fade.end.x: keyframe_points.remove(keyframe, fast=True) - except BaseException: + except Exception: pass fade_fcurve.update() diff --git a/scripts/startup/bl_operators/userpref.py b/scripts/startup/bl_operators/userpref.py index ee8367f0b09..8291d7a4acc 100644 --- a/scripts/startup/bl_operators/userpref.py +++ b/scripts/startup/bl_operators/userpref.py @@ -256,7 +256,7 @@ class PREFERENCES_OT_keyconfig_import(Operator): shutil.copy(self.filepath, path) else: shutil.move(self.filepath, path) - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, rpt_("Installing keymap failed: {:s}").format(str(ex))) return {'CANCELLED'} @@ -617,7 +617,7 @@ class PREFERENCES_OT_theme_install(Operator): filepath=path_dest, menu_idname="USERPREF_MT_interface_theme_presets", ) - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} @@ -727,7 +727,7 @@ class PREFERENCES_OT_addon_install(Operator): if not os.path.isdir(path_addons): try: os.makedirs(path_addons, exist_ok=True) - except BaseException: + except Exception: traceback.print_exc() # Check if we are installing from a target path, @@ -749,7 +749,7 @@ class PREFERENCES_OT_addon_install(Operator): if zipfile.is_zipfile(pyfile): try: file_to_extract = zipfile.ZipFile(pyfile, "r") - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} @@ -772,7 +772,7 @@ class PREFERENCES_OT_addon_install(Operator): try: # extract the file to "addons" file_to_extract.extractall(path_addons) - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} @@ -788,7 +788,7 @@ class PREFERENCES_OT_addon_install(Operator): # if not compressed file just copy into the addon path try: shutil.copyfile(pyfile, path_dest) - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} @@ -1006,7 +1006,7 @@ class PREFERENCES_OT_app_template_install(Operator): if not os.path.isdir(path_app_templates): try: os.makedirs(path_app_templates, exist_ok=True) - except BaseException: + except Exception: traceback.print_exc() app_templates_old = set(os.listdir(path_app_templates)) @@ -1015,7 +1015,7 @@ class PREFERENCES_OT_app_template_install(Operator): if zipfile.is_zipfile(filepath): try: file_to_extract = zipfile.ZipFile(filepath, "r") - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} @@ -1031,7 +1031,7 @@ class PREFERENCES_OT_app_template_install(Operator): try: # extract the file to "bl_app_templates_user" file_to_extract.extractall(path_app_templates) - except BaseException: + except Exception: traceback.print_exc() return {'CANCELLED'} diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index 8dd5c363676..f8f4f0487ad 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -556,7 +556,7 @@ class WM_OT_context_toggle_enum(Operator): self.value_1, ) ) - except BaseException: + except Exception: return {'PASS_THROUGH'} return operator_path_undo_return(context, data_path) @@ -873,7 +873,7 @@ class WM_OT_context_collection_boolean_set(Operator): for item in items: try: value_orig = eval("item." + data_path_item) - except BaseException: + except Exception: continue if value_orig is True: @@ -941,13 +941,13 @@ class WM_OT_context_modal_mouse(Operator): for item in getattr(context, data_path_iter): try: value_orig = eval("item." + data_path_item) - except BaseException: + except Exception: continue # check this can be set, maybe this is library data. try: exec("item.{:s} = {:s}".format(data_path_item, str(value_orig))) - except BaseException: + except Exception: continue values[item] = value_orig @@ -1180,7 +1180,7 @@ class WM_OT_path_open(Operator): else: try: subprocess.check_call(["xdg-open", filepath]) - except BaseException: + except Exception: # `xdg-open` *should* be supported by recent Gnome, KDE, XFCE. import traceback traceback.print_exc() @@ -1867,12 +1867,12 @@ class WM_OT_properties_edit(Operator): if prop_type_new == 'PYTHON': try: new_value = eval(self.eval_string) - except BaseException as ex: + except Exception as ex: self.report({'WARNING'}, "Python evaluation failed: " + str(ex)) return {'CANCELLED'} try: item[name] = new_value - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, "Failed to assign value: " + str(ex)) return {'CANCELLED'} if name_old != name: @@ -2072,7 +2072,7 @@ class WM_OT_properties_edit_value(Operator): rna_item = eval("context.{:s}".format(self.data_path)) try: new_value = eval(self.eval_string) - except BaseException as ex: + except Exception as ex: self.report({'WARNING'}, "Python evaluation failed: " + str(ex)) return {'CANCELLED'} rna_item[self.property_name] = new_value @@ -3093,7 +3093,7 @@ class WM_OT_batch_rename(Operator): if action.use_replace_regex_src: try: re.compile(action.replace_src) - except BaseException as ex: + except Exception as ex: re_error_src = str(ex) row.alert = True @@ -3119,7 +3119,7 @@ class WM_OT_batch_rename(Operator): if re_error_src is None: try: re.sub(action.replace_src, action.replace_dst, "") - except BaseException as ex: + except Exception as ex: re_error_dst = str(ex) row.alert = True @@ -3195,14 +3195,14 @@ class WM_OT_batch_rename(Operator): if action.use_replace_regex_src: try: re.compile(action.replace_src) - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, "Invalid regular expression (find): " + str(ex)) return {'CANCELLED'} if action.use_replace_regex_dst: try: re.sub(action.replace_src, action.replace_dst, "") - except BaseException as ex: + except Exception as ex: self.report({'ERROR'}, "Invalid regular expression (replace): " + str(ex)) return {'CANCELLED'} diff --git a/scripts/startup/bl_ui/space_toolsystem_common.py b/scripts/startup/bl_ui/space_toolsystem_common.py index e83db7aaca2..d4f3dcf5c63 100644 --- a/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/scripts/startup/bl_ui/space_toolsystem_common.py @@ -245,7 +245,7 @@ class ToolSelectPanelHelper: filepath = os.path.join(dirname, icon_name + ".dat") try: icon_value = bpy.app.icons.new_triangles_from_file(filepath) - except BaseException as ex: + except Exception as ex: if not os.path.exists(filepath): print("Missing icons:", filepath, ex) else: diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 2bebf55dc8d..86839c3afcc 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -2419,7 +2419,7 @@ class USERPREF_PT_addons(AddOnPanel, Panel): addon_preferences_class.layout = box_prefs try: draw(context) - except BaseException: + except Exception: import traceback traceback.print_exc() box_prefs.label(text="Error (see console)", icon='ERROR') diff --git a/tests/python/bl_imbuf_load.py b/tests/python/bl_imbuf_load.py index 423809fbd20..54c0e353ba0 100644 --- a/tests/python/bl_imbuf_load.py +++ b/tests/python/bl_imbuf_load.py @@ -45,9 +45,9 @@ class ImBufTest(AbstractImBufTest): expected_metadata = ref_metadata_path.read_text(encoding="utf-8") failed = not (actual_metadata == expected_metadata) - except BaseException as e: + except Exception as ex: if self.verbose: - print_message(e.output.decode("utf-8", 'ignore')) + print_message(ex.output.decode("utf-8", 'ignore')) failed = True else: if not self.update: diff --git a/tests/python/bl_pyapi_bpy_driver_secure_eval.py b/tests/python/bl_pyapi_bpy_driver_secure_eval.py index 79d460e7b2a..94d8cf4e27d 100644 --- a/tests/python/bl_pyapi_bpy_driver_secure_eval.py +++ b/tests/python/bl_pyapi_bpy_driver_secure_eval.py @@ -92,7 +92,7 @@ class _TestExprMixIn: ) # exec(expr_code, {}, bpy.app.driver_namespace) ex = None - except BaseException as ex_test: + except Exception as ex_test: ex = ex_test if self.expressions_expect_unreachable: diff --git a/tests/python/eevee_next_render_tests.py b/tests/python/eevee_next_render_tests.py index acec34583e1..3b3cf4f100c 100644 --- a/tests/python/eevee_next_render_tests.py +++ b/tests/python/eevee_next_render_tests.py @@ -154,7 +154,7 @@ def get_gpu_device_type(blender): if line.startswith("GPU_DEVICE_TYPE:"): vendor = line.split(':')[1] return vendor - except BaseException as e: + except Exception: return None return None diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py index c59d0132605..227556af40a 100755 --- a/tests/python/modules/render_report.py +++ b/tests/python/modules/render_report.py @@ -505,7 +505,7 @@ class Report: if completed_process.returncode != 0: crash = True output = completed_process.stdout - except BaseException: + except Exception: crash = True if verbose: diff --git a/tools/utils/addr2line_backtrace.py b/tools/utils/addr2line_backtrace.py index 4a7fdfab7a4..294e80185b4 100755 --- a/tools/utils/addr2line_backtrace.py +++ b/tools/utils/addr2line_backtrace.py @@ -219,7 +219,7 @@ def main() -> None: try: with open(backtrace_filepath, 'r', encoding="utf-8", errors="surrogateescape") as fh: bactrace_data = fh.read() - except BaseException as ex: + except Exception as ex: print("Filed to open {!r}, {:s}".format(backtrace_filepath, str(ex))) continue