From e5a0bc3ecd4d9c46ead3b8217584eaa916a3afa4 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Thu, 24 Aug 2023 16:38:47 +0100 Subject: MLIA-961 Update tox dependencies - Update version dependencies in the tox.ini - Fix linter issues Change-Id: I04c3a841ee2646a865dab037701d66c28792f2a4 Signed-off-by: Benjamin Klimczak --- src/mlia/core/mixins.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mlia/core/mixins.py') 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 -- cgit v1.2.1