Skip to content

Commit

Permalink
fix typing for tar provider
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed Feb 7, 2025
1 parent aa3944e commit adae52d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions faker/providers/misc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uuid
import zipfile

from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, Union
from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Set, Tuple, Type, Union

from typing_extensions import TypeAlias

Expand Down Expand Up @@ -280,14 +280,13 @@ def tar(
raise AssertionError(
"`uncompressed_size` is smaller than the calculated minimum required size",
)
mode: Literal["w|", "w|gz", "w|bz2", "w|xz"] = "w|"
if compression in ["gzip", "gz"]:
mode = "w:gz"
mode = "w|gz"
elif compression in ["bzip2", "bz2"]:
mode = "w:bz2"
mode = "w|bz2"
elif compression in ["lzma", "xz"]:
mode = "w:xz"
else:
mode = "w"
mode = "w|xz"

tar_buffer = io.BytesIO()
remaining_size = uncompressed_size
Expand Down

0 comments on commit adae52d

Please sign in to comment.