Cleanup: add "unreachable" message to "assert False" statements
Clarify that these blocks are unreachable so the intention is clear if they're ever encountered.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user