summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-02-25 19:58:43 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-03-02 07:21:21 +0100
commitce1f66fd9fbccd8dc27ffb6d8338ab3566d03026 (patch)
tree3737440382fc2101c9cc5ee5962983d66c42030b
parent802f4bf49c8b8d3776f9f8b3fb1cce6a0bbd9f76 (diff)
downloadpython-linuxnamespaces-ce1f66fd9fbccd8dc27ffb6d8338ab3566d03026.tar.gz
examples/chroottar.py: make pylint happier
-rwxr-xr-xexamples/chroottar.py7
1 files 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}")