From ce1f66fd9fbccd8dc27ffb6d8338ab3566d03026 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 25 Feb 2024 19:58:43 +0100 Subject: examples/chroottar.py: make pylint happier --- examples/chroottar.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/chroottar.py b/examples/chroottar.py index 69acd46..d229956 100755 --- a/examples/chroottar.py +++ b/examples/chroottar.py @@ -39,8 +39,10 @@ class TarFile(tarfile.TarFile): raise NotImplementedError("zst does not support a fileobj") try: import zstandard - except ImportError: - raise tarfile.CompressionError("zstandard module not available") + except ImportError as err: + raise tarfile.CompressionError( + "zstandard module not available" + ) from err if mode == "r": zfobj = zstandard.open(name, "rb") else: @@ -80,6 +82,7 @@ class TarFile(tarfile.TarFile): "zstd": "zst", }[compmodule] except KeyError: + # pylint: disable=raise-missing-from # no value in chaining raise ValueError(f"cannot guess comptype for module {compmodule}") -- cgit v1.2.3