diff --git a/pyproject.toml b/pyproject.toml index ea9de4e3f60ab4ded5042a8ed605491f20d38c44..5f4771da2d7d218e28f11b24263b51df31dcbc64 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 6c1e6e9b5875853008dc3a43200fa972575fc180..738ced9fe63ea26df01470d9b3c73e9fb082278a 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