summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/chroottar.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/chroottar.py b/examples/chroottar.py
index 523892c..8b374d1 100755
--- a/examples/chroottar.py
+++ b/examples/chroottar.py
@@ -13,6 +13,7 @@ import socket
import sys
import tarfile
import tempfile
+import typing
if __file__.split("/")[-2:-1] == ["examples"]:
sys.path.insert(0, "/".join(__file__.split("/")[:-2]))
@@ -27,7 +28,10 @@ class TarFile(tarfile.TarFile):
@classmethod
def zstopen(
- cls, name: str, mode: str = "r", fileobj: None = None
+ cls,
+ name: str,
+ mode: typing.Literal["r", "w", "x"] = "r",
+ fileobj: None = None,
) -> tarfile.TarFile:
if mode not in ("r", "w", "x"):
raise NotImplementedError(f"mode `{mode}' not implemented for zst")