summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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}")