diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-07 12:27:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-07 12:29:57 +0300 |
commit | 97cd8bfae19666554db17c42b3d2a7cfa16498f8 (patch) | |
tree | e6c6ac3f58bd5fde555c61ce70018cb1ea8f38af /release/scripts/modules/bpy_extras/keyconfig_utils.py | |
parent | 4b373ed086993e5163c8a9a129400747bf6bed1c (diff) |
Cleanup: isinstance can take multiple types
Diffstat (limited to 'release/scripts/modules/bpy_extras/keyconfig_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 92674bfc5f6..3a9570a57c4 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -240,9 +240,9 @@ def _export_properties(prefix, properties, kmi_id, lines=None): lines = [] def string_value(value): - if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int): + if isinstance(value, (str, bool, float, int)): return repr(value) - elif getattr(value, '__len__', False): + elif hasattr(value, "__len__"): return repr(list(value)) print("Export key configuration: can't write ", value) |