Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5f889c4

Browse filesBrowse files
committed
try: from typing import Literal
1 parent aa9298a commit 5f889c4
Copy full SHA for 5f889c4

File tree

5 files changed

+27
-5
lines changed
Filter options

5 files changed

+27
-5
lines changed

‎git/objects/blob.py

Copy file name to clipboardExpand all lines: git/objects/blob.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
from mimetypes import guess_type
77
from . import base
88

9-
from git.types import Literal
9+
10+
try:
11+
from typing import Literal
12+
except ImportError:
13+
from typing_extensions import Literal
1014

1115
__all__ = ("Blob",)
1216

‎git/objects/commit.py

Copy file name to clipboardExpand all lines: git/objects/commit.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
Dict,
4545
)
4646

47-
from git.types import PathLike, Literal
47+
from git.types import PathLike
48+
49+
try:
50+
from typing import Literal
51+
except ImportError:
52+
from typing_extensions import Literal
4853

4954
if TYPE_CHECKING:
5055
from git.repo import Repo

‎git/objects/submodule/base.py

Copy file name to clipboardExpand all lines: git/objects/submodule/base.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@
4444
from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast
4545
from typing import Any, Iterator, Union
4646

47-
from git.types import Commit_ish, Literal, PathLike, TBD
47+
from git.types import Commit_ish, PathLike, TBD
48+
49+
try:
50+
from typing import Literal
51+
except ImportError:
52+
from typing_extensions import Literal
4853

4954
if TYPE_CHECKING:
5055
from git.index import IndexFile

‎git/objects/tag.py

Copy file name to clipboardExpand all lines: git/objects/tag.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
from typing import List, TYPE_CHECKING, Union
1818

19-
from git.types import Literal
19+
try:
20+
from typing import Literal
21+
except ImportError:
22+
from typing_extensions import Literal
2023

2124
if TYPE_CHECKING:
2225
from git.repo import Repo

‎git/objects/tree.py

Copy file name to clipboardExpand all lines: git/objects/tree.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
TYPE_CHECKING,
3232
)
3333

34-
from git.types import PathLike, Literal
34+
from git.types import PathLike
35+
36+
try:
37+
from typing import Literal
38+
except ImportError:
39+
from typing_extensions import Literal
3540

3641
if TYPE_CHECKING:
3742
from git.repo import Repo

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.