Skip to content

Commit

Permalink
try: from typing import Literal
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 11, 2024
1 parent 53b2567 commit a083e81
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
6 changes: 5 additions & 1 deletion git/objects/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from mimetypes import guess_type
from . import base

from git.types import Literal

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

__all__ = ("Blob",)

Expand Down
7 changes: 6 additions & 1 deletion git/objects/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
Dict,
)

from git.types import PathLike, Literal
from git.types import PathLike

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

if TYPE_CHECKING:
from git.repo import Repo
Expand Down
7 changes: 6 additions & 1 deletion git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast
from typing import Any, Iterator, Union

from git.types import Commit_ish, Literal, PathLike, TBD
from git.types import Commit_ish, PathLike, TBD

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

if TYPE_CHECKING:
from git.index import IndexFile
Expand Down
5 changes: 4 additions & 1 deletion git/objects/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

from typing import List, TYPE_CHECKING, Union

from git.types import Literal
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

if TYPE_CHECKING:
from git.repo import Repo
Expand Down
7 changes: 6 additions & 1 deletion git/objects/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
TYPE_CHECKING,
)

from git.types import PathLike, Literal
from git.types import PathLike

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

if TYPE_CHECKING:
from git.repo import Repo
Expand Down

0 comments on commit a083e81

Please sign in to comment.