From 4ab39bf09122331f2ae02e4230fb4e0fd91e94b1 Mon Sep 17 00:00:00 2001 From: Santosh kumar <29346072+santoshkumarradha@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:22:31 -0400 Subject: [PATCH] Making qelectron import within try except. (#1954) * moving supression of import error to try to deal with other errors until we update pennylane for qelectron * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated changelog --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: kessler-frost --- CHANGELOG.md | 4 ++++ covalent/__init__.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4dc7a665..982fa3bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Fixed + +- Ignoring all errors when importing qelectrons instead of only `ImportError` + ## [0.235.0-rc.0] - 2024-05-29 ### Authors diff --git a/covalent/__init__.py b/covalent/__init__.py index 0cfc7bbe7..d644a57d6 100644 --- a/covalent/__init__.py +++ b/covalent/__init__.py @@ -51,7 +51,8 @@ from ._workflow.electron import wait # nopycln: import from .executor.utils import get_context # nopycln: import -with contextlib.suppress(ImportError): +with contextlib.suppress(Exception): + # try to load qelectron modules from ._workflow.qelectron import qelectron # nopycln: import from .quantum import QCluster # nopycln: import