Skip to content

Commit 079d7fd

Browse files
committed
try fix for Protocol buy in 3.10
1 parent 4381f6c commit 079d7fd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git/objects/util.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
from datetime import datetime, timedelta, tzinfo
2323

2424
# typing ------------------------------------------------------------
25-
from typing import (Any, Callable, Deque, Iterator, NamedTuple, overload, Sequence,
25+
from typing import (Any, Callable, Deque, Iterator, Generic, NamedTuple, overload, Sequence,
2626
TYPE_CHECKING, Tuple, Type, TypeVar, Union, cast)
2727

28-
from git.types import Has_id_attribute, Literal, Protocol, runtime_checkable
28+
from git.types import Has_id_attribute, Literal
2929

3030
if TYPE_CHECKING:
3131
from io import BytesIO, StringIO
@@ -35,6 +35,12 @@
3535
from .tree import Tree, TraversedTreeTup
3636
from subprocess import Popen
3737
from .submodule.base import Submodule
38+
from git.types import Protocol, runtime_checkable
39+
else:
40+
Protocol = Generic
41+
42+
def runtime_checkable(f):
43+
return f
3844

3945

4046
class TraverseNT(NamedTuple):

0 commit comments

Comments
 (0)