diff options
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bl_keymap_utils/io.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py index ee08a2d7fb0..531c620348d 100644 --- a/release/scripts/modules/bl_keymap_utils/io.py +++ b/release/scripts/modules/bl_keymap_utils/io.py @@ -227,7 +227,6 @@ def _kmi_props_setattr(kmi_props, attr, value): def keymap_init_from_data(km, km_items, is_modal=False): - assert type(km_items) is list new_fn = getattr(km.keymap_items, "new_modal" if is_modal else "new") for (kmi_idname, kmi_args, kmi_data) in km_items: kmi = new_fn(kmi_idname, **kmi_args) @@ -248,7 +247,14 @@ def keyconfig_init_from_data(kc, keyconfig_data): # Runs at load time, keep this fast! for (km_name, km_args, km_content) in keyconfig_data: km = kc.keymaps.new(km_name, **km_args) - keymap_init_from_data(km, km_content["items"], is_modal=km_args.get("modal", False)) + km_items = km_content["items"] + # Check here instead of inside 'keymap_init_from_data' + # because we want to allow both tuple & list types in that case. + # + # For full keymaps, ensure these are always lists to allow for extending them + # in a generic way that doesn't have to check for the type each time. + assert type(km_items) is list + keymap_init_from_data(km, km_items, is_modal=km_args.get("modal", False)) def keyconfig_import_from_data(name, keyconfig_data): |