From 2fdbf852c3ce9f1d734e9b81bc6bd93284bd73fb Mon Sep 17 00:00:00 2001 From: Renato Mello Date: Wed, 16 Oct 2024 14:04:00 +0400 Subject: [PATCH] lint improvements --- src/qibo/backends/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/qibo/backends/__init__.py b/src/qibo/backends/__init__.py index 74f74e1187..3e6baed39b 100644 --- a/src/qibo/backends/__init__.py +++ b/src/qibo/backends/__init__.py @@ -216,7 +216,7 @@ def list_available_backends(*providers: str) -> dict: return available_backends -def construct_backend(backend, **kwargs) -> Backend: +def construct_backend(backend, **kwargs) -> Backend: # pylint: disable=R1710 """Construct a generic native or non-native qibo backend. Args: @@ -235,11 +235,12 @@ def construct_backend(backend, **kwargs) -> Backend: except ImportError as e: # pylint: disable=unsupported-membership-test if provider not in e.msg: - raise e - raise MissingBackend( + raise_error(e) + raise_error( + MissingBackend, f"The '{backend}' backends' provider is not available. Check that a Python " - f"package named '{provider}' is installed, and it is exposing valid Qibo " - "backends.", + + f"package named '{provider}' is installed, and it is exposing valid Qibo " + + "backends.", )