diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-08-24 16:38:47 +0100 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-09-05 14:20:08 +0100 |
commit | e5a0bc3ecd4d9c46ead3b8217584eaa916a3afa4 (patch) | |
tree | 94c348fcef50326a755a049a2a4027f588211f8b /src/mlia/core/mixins.py | |
parent | 900c3c52b681e0b8a4454e2e2cf29265d53a2c98 (diff) | |
download | mlia-e5a0bc3ecd4d9c46ead3b8217584eaa916a3afa4.tar.gz |
MLIA-961 Update tox dependencies
- Update version dependencies in the tox.ini
- Fix linter issues
Change-Id: I04c3a841ee2646a865dab037701d66c28792f2a4
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'src/mlia/core/mixins.py')
-rw-r--r-- | src/mlia/core/mixins.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mlia/core/mixins.py b/src/mlia/core/mixins.py index 5ef9d66..e50e6f7 100644 --- a/src/mlia/core/mixins.py +++ b/src/mlia/core/mixins.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Mixins module.""" from __future__ import annotations @@ -35,21 +35,21 @@ class ParameterResolverMixin: ctx = context or self.context if ctx.config_parameters is None: - raise Exception("Configuration parameters are not set") + raise ValueError("Configuration parameters are not set.") section_params = ctx.config_parameters.get(section) if section_params is None or not isinstance(section_params, dict): - raise Exception( + raise ValueError( f"Parameter section {section} has wrong format, " - "expected to be a dictionary" + "expected to be a dictionary." ) value = section_params.get(name) if not value and expected: - raise Exception(f"Parameter {name} is not set") + raise ValueError(f"Parameter {name} is not set.") if value and expected_type is not None and not isinstance(value, expected_type): - raise Exception(f"Parameter {name} expected to have type {expected_type}") + raise TypeError(f"Parameter {name} expected to have type {expected_type}.") return value |