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 | |
parent | 4b373ed086993e5163c8a9a129400747bf6bed1c (diff) |
Cleanup: isinstance can take multiple types
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_texture.py | 2 |
2 files changed, 3 insertions, 3 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) diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 7da34782364..018f3df6f0d 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -1203,7 +1203,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel): col.prop(tex, "invert", text="Negative") col.prop(tex, "use_stencil") - if isinstance(idblock, Material) or isinstance(idblock, World): + if isinstance(idblock, (Material, World)): col.prop(tex, "default_value", text="DVar", slider=True) if isinstance(idblock, Material): |