From 7612b33ec562651deec3acddcc4845fd850dd974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Thu, 7 Mar 2024 11:05:14 +0100 Subject: [PATCH] fix earlier unit test breakage --- pyproject.toml | 2 +- satella/coding/recast_exceptions.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ea9de4e3..5f4771da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Libraries" ] -dependencies = ["psutil"] +dependencies = ["psutil>=5.9.8"] [tool.setuptools.dynamic] version = { attr = "satella.__version__" } diff --git a/satella/coding/recast_exceptions.py b/satella/coding/recast_exceptions.py index 6c1e6e9b..738ced9f 100644 --- a/satella/coding/recast_exceptions.py +++ b/satella/coding/recast_exceptions.py @@ -166,8 +166,10 @@ class reraise_as: try: return fun(*args, **kwargs) except Exception as e: # pylint: disable=broad-except - if isinstance(e, self.source) and self.target_exc is not None: - raise self.target_exc(*self.args, **self.kwargs) from e + if isinstance(e, self.source): + if self.target_exc is not None: + raise self.target_exc(*self.args, **self.kwargs) from e + return raise return inner -- GitLab