diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-14 09:18:59 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-14 09:18:59 +0300 |
commit | 39c341bf4ab9582edc26227447634cae2004baa6 (patch) | |
tree | dce6d8f00adbca2b3b6c7be99119507023beab92 /release/scripts/modules | |
parent | 260b75a952f40961d3e06c9a7f48ec9b696bf169 (diff) |
Cleanup: remove redundant braces from assert & raise
autopep8 v1.7 added a space after assert & raise,
remove the braces as they aren't needed.
Diffstat (limited to 'release/scripts/modules')
11 files changed, 19 insertions, 19 deletions
diff --git a/release/scripts/modules/bl_app_override/__init__.py b/release/scripts/modules/bl_app_override/__init__.py index 4d6194e71cd..1408cf3594f 100644 --- a/release/scripts/modules/bl_app_override/__init__.py +++ b/release/scripts/modules/bl_app_override/__init__.py @@ -74,7 +74,7 @@ def ui_draw_filter_register( if ui_test is None: UILayout.__getattribute__(self, "label")(text="") else: - assert(ui_test is True) + assert ui_test is True # may need to be set ret = OperatorProperties_Fake() return ret @@ -95,7 +95,7 @@ def ui_draw_filter_register( if ui_test is None: UILayout.__getattribute__(self, "label")(text="") else: - assert(ui_test is True) + assert ui_test is True ret = None return ret return dummy_func @@ -115,7 +115,7 @@ def ui_draw_filter_register( if ui_test is None: UILayout.__getattribute__(self, "label")(text="") else: - assert(ui_test is True) + assert ui_test is True ret = None return ret return dummy_func @@ -135,7 +135,7 @@ def ui_draw_filter_register( if ui_test is None: real_func(text="") else: - assert(ui_test is True) + assert ui_test is True ret = None return ret return dummy_func diff --git a/release/scripts/modules/bl_app_override/helpers.py b/release/scripts/modules/bl_app_override/helpers.py index 4759e0ae8e5..0b785511886 100644 --- a/release/scripts/modules/bl_app_override/helpers.py +++ b/release/scripts/modules/bl_app_override/helpers.py @@ -44,14 +44,14 @@ class AppOverrideState: self._ui_ignore_store = None def _setup_classes(self): - assert(self._class_store is None) + assert self._class_store is None self._class_store = self.class_ignore() from bpy.utils import unregister_class for cls in self._class_store: unregister_class(cls) def _teardown_classes(self): - assert(self._class_store is not None) + assert self._class_store is not None from bpy.utils import register_class for cls in self._class_store: diff --git a/release/scripts/modules/bl_console_utils/autocomplete/complete_import.py b/release/scripts/modules/bl_console_utils/autocomplete/complete_import.py index 2f321fee0b2..1a97e408b70 100644 --- a/release/scripts/modules/bl_console_utils/autocomplete/complete_import.py +++ b/release/scripts/modules/bl_console_utils/autocomplete/complete_import.py @@ -42,7 +42,7 @@ def get_root_modules(): """ global ROOT_MODULES modules = [] - if not(ROOT_MODULES is None): + if not (ROOT_MODULES is None): return ROOT_MODULES from time import time t = time() @@ -131,7 +131,7 @@ def complete(line): if only_modules: return inspect.ismodule(getattr(module, attr)) else: - return not(attr[:2] == '__' and attr[-2:] == '__') + return not (attr[:2] == '__' and attr[-2:] == '__') try: m = __import__(mod) diff --git a/release/scripts/modules/bl_console_utils/autocomplete/complete_namespace.py b/release/scripts/modules/bl_console_utils/autocomplete/complete_namespace.py index 4ba446d6832..096e5596fc6 100644 --- a/release/scripts/modules/bl_console_utils/autocomplete/complete_namespace.py +++ b/release/scripts/modules/bl_console_utils/autocomplete/complete_namespace.py @@ -132,7 +132,7 @@ def complete(word, namespace, *, private=True): matches = complete_indices(word, namespace, base=re_incomplete_index.group(1)) - elif not('[' in word): + elif not ('[' in word): matches = complete_names(word, namespace) elif word[-1] == ']': @@ -182,7 +182,7 @@ def complete(word, namespace, *, private=True): matches = [word + '.'] # separate public from private - public_matches = [match for match in matches if not('._' in match)] + public_matches = [match for match in matches if not ('._' in match)] if private: private_matches = [match for match in matches if '._' in match] return public_matches + private_matches diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py index 77ab70f8d91..374b90446f3 100644 --- a/release/scripts/modules/bl_i18n_utils/settings.py +++ b/release/scripts/modules/bl_i18n_utils/settings.py @@ -87,7 +87,7 @@ LANGUAGES = ( # Default context, in py (keep in sync with `BLT_translation.h`)! if bpy is not None: - assert(bpy.app.translations.contexts.default == "*") + assert bpy.app.translations.contexts.default == "*" DEFAULT_CONTEXT = "*" # Name of language file used by Blender to generate translations' menu. diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 324c3ea261d..784b206fb84 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -68,7 +68,7 @@ def locale_explode(locale): try: import bpy.app.translations as bpy_translations - assert(ret == bpy_translations.locale_explode(locale)) + assert ret == bpy_translations.locale_explode(locale) except ModuleNotFoundError: pass diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py index 5d74ffbcf56..8d849498bd7 100644 --- a/release/scripts/modules/bl_keymap_utils/io.py +++ b/release/scripts/modules/bl_keymap_utils/io.py @@ -229,7 +229,7 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False): # Take care making changes that could impact performance. def _init_properties_from_data(base_props, base_value): - assert(type(base_value) is list) + assert type(base_value) is list for attr, value in base_value: if type(value) is list: base_props.property_unset(attr) diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 35b7d564a5e..b6da6c7768c 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -295,7 +295,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 0 def axis_conversion_ensure(operator, forward_attr, up_attr): diff --git a/release/scripts/modules/bpy_extras/node_shader_utils.py b/release/scripts/modules/bpy_extras/node_shader_utils.py index cda291c6c90..0c349084220 100644 --- a/release/scripts/modules/bpy_extras/node_shader_utils.py +++ b/release/scripts/modules/bpy_extras/node_shader_utils.py @@ -13,7 +13,7 @@ def _set_check(func): @wraps(func) def wrapper(self, *args, **kwargs): if self.is_readonly: - assert(not "Trying to set value to read-only shader!") + assert not "Trying to set value to read-only shader!" return return func(self, *args, **kwargs) return wrapper diff --git a/release/scripts/modules/bpy_extras/wm_utils/progress_report.py b/release/scripts/modules/bpy_extras/wm_utils/progress_report.py index 637d60838db..371d598042c 100644 --- a/release/scripts/modules/bpy_extras/wm_utils/progress_report.py +++ b/release/scripts/modules/bpy_extras/wm_utils/progress_report.py @@ -93,7 +93,7 @@ class ProgressReport: def leave_substeps(self, msg=""): if (msg): self.update(msg) - assert(len(self.steps) > 1) + assert len(self.steps) > 1 del self.steps[-1] del self.curr_step[-1] del self.start_time[-1] @@ -134,7 +134,7 @@ class ProgressReportSubstep: return self def __exit__(self, exc_type, exc_value, traceback): - assert(len(self.progress.steps) > self.level) + assert len(self.progress.steps) > self.level while len(self.progress.steps) > self.level + 1: self.progress.leave_substeps() self.progress.leave_substeps(self.final_msg) diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 8b8cfaaccc5..5f4a6b8cf38 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -127,7 +127,7 @@ def draw(layout, context, context_member, property_type, *, use_edit=True): use_edit = False is_lib_override = rna_item.id_data.override_library and rna_item.id_data.override_library.reference - assert(isinstance(rna_item, property_type)) + assert isinstance(rna_item, property_type) items = list(rna_item.items()) items.sort() @@ -183,7 +183,7 @@ def draw(layout, context, context_member, property_type, *, use_edit=True): # Do not allow editing of overridden properties (we cannot use a poll function # of the operators here since they's have no access to the specific property). - operator_row.enabled = not(is_lib_override and key in rna_item.id_data.override_library.reference) + operator_row.enabled = not (is_lib_override and key in rna_item.id_data.override_library.reference) if use_edit: if is_rna: |