diff --git a/doc/python_api/rst_from_bmesh_opdefines.py b/doc/python_api/rst_from_bmesh_opdefines.py index 81a90798355..f84224830db 100644 --- a/doc/python_api/rst_from_bmesh_opdefines.py +++ b/doc/python_api/rst_from_bmesh_opdefines.py @@ -252,8 +252,7 @@ def main(): name, tp = arg tp_sub = None else: - print(arg) - assert 0 + assert False, "unreachable, unsupported 'arg' length found %d" % len(arg) tp_str = "" @@ -322,8 +321,7 @@ def main(): # but think the idea is that that pointer is for any type? tp_str = ":class:`bpy.types.bpy_struct`" else: - print("Can't find", vars_dict_reverse[tp_sub]) - assert 0 + assert False, "unreachable, unknown type %r" % vars_dict_reverse[tp_sub] elif tp == BMO_OP_SLOT_ELEMENT_BUF: assert tp_sub is not None @@ -362,11 +360,9 @@ def main(): elif tp_sub == BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL: tp_str += "unknown internal data, not compatible with python" else: - print("Can't find", vars_dict_reverse[tp_sub]) - assert 0 + assert False, "unreachable, unknown type %r" % vars_dict_reverse[tp_sub] else: - print("Can't find", vars_dict_reverse[tp]) - assert 0 + assert False, "unreachable, unknown type %r" % vars_dict_reverse[tp] args_wash.append((name, default_value, tp_str, comment)) return args_wash diff --git a/scripts/modules/bpy_extras/io_utils.py b/scripts/modules/bpy_extras/io_utils.py index e45924e2fc1..536747b3930 100644 --- a/scripts/modules/bpy_extras/io_utils.py +++ b/scripts/modules/bpy_extras/io_utils.py @@ -297,7 +297,7 @@ def axis_conversion(from_forward='Y', from_up='Z', to_forward='Y', to_up='Z'): for i, axis_lut in enumerate(_axis_convert_lut): if value in axis_lut: return Matrix(_axis_convert_matrix[i]) - assert 0 + assert False, "unreachable" def axis_conversion_ensure(operator, forward_attr, up_attr): diff --git a/scripts/presets/keyconfig/keymap_data/blender_default.py b/scripts/presets/keyconfig/keymap_data/blender_default.py index ecc4967b90a..16e3ddcc16b 100644 --- a/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -768,7 +768,7 @@ def km_window(params): ("wm.search_menu", {"type": 'SPACE', "value": 'PRESS'}, None), ) else: - assert False + assert False, "unreachable" return keymap @@ -3530,7 +3530,7 @@ def km_frames(params): ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS'}, None), ) else: - assert False + assert False, "unreachable" items.extend([ ("screen.animation_play", {"type": 'SPACE', "value": 'PRESS', "shift": True, "ctrl": True}, diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index 17daf58346e..69292ad0346 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -2959,7 +2959,7 @@ class WM_OT_batch_rename(Operator): elif method == 'SUFFIX': name = name + text else: - assert 0 + assert False, "unreachable" elif ty == 'STRIP': chars = action.strip_chars @@ -3004,9 +3004,9 @@ class WM_OT_batch_rename(Operator): elif method == 'TITLE': name = name.title() else: - assert 0 + assert False, "unreachable" else: - assert 0 + assert False, "unreachable" return name def _data_update(self, context): diff --git a/tools/check_source/check_spelling.py b/tools/check_source/check_spelling.py index e5e452fa556..99f265c67ce 100755 --- a/tools/check_source/check_spelling.py +++ b/tools/check_source/check_spelling.py @@ -272,7 +272,7 @@ def words_from_text(text: str, check_type: str) -> List[Tuple[str, int]]: w_prev = w_lower w_prev_start = w_start else: - assert False + assert False, "unreachable" return words @@ -551,7 +551,7 @@ def spell_check_file( # print(filepath + ":" + str(slineno + 1) + ":" + str(scol), w, "(duplicates)") yield (w, slineno, scol) else: - assert False + assert False, "unreachable" def spell_check_file_recursive( diff --git a/tools/modules/blendfile.py b/tools/modules/blendfile.py index 12a3c09a442..6f85b2579ed 100644 --- a/tools/modules/blendfile.py +++ b/tools/modules/blendfile.py @@ -772,7 +772,7 @@ class BlendFileHeader: elif pointer_size_id == b'_': self.pointer_size = 4 else: - assert 0 + assert False, "unreachable" endian_id = values[2] if endian_id == b'v': self.is_little_endian = True @@ -783,7 +783,7 @@ class BlendFileHeader: self.endian_index = 1 self.endian_str = b'>' else: - assert 0 + assert False, "unreachable" version_id = values[3] self.version = int(version_id)