summaryrefslogtreecommitdiff
path: root/git/objects
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-08-09 09:55:56 +0100
committerYobmod <yobmod@gmail.com>2021-08-09 09:55:56 +0100
commit079d7fd6994bc6751bef4797a027b9e6daf966f4 (patch)
tree712aca19d11ac49facd36e41bc00ac26f01a7271 /git/objects
parent4381f6cb175c2749f05ca45f6cfa4f3e277a13c3 (diff)
downloadgitpython-079d7fd6994bc6751bef4797a027b9e6daf966f4.tar.gz
try fix for Protocol buy in 3.10
Diffstat (limited to 'git/objects')
-rw-r--r--git/objects/util.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/git/objects/util.py b/git/objects/util.py
index 16d4c0ac..9f98db56 100644
--- a/git/objects/util.py
+++ b/git/objects/util.py
@@ -22,10 +22,10 @@ import calendar
from datetime import datetime, timedelta, tzinfo
# typing ------------------------------------------------------------
-from typing import (Any, Callable, Deque, Iterator, NamedTuple, overload, Sequence,
+from typing import (Any, Callable, Deque, Iterator, Generic, NamedTuple, overload, Sequence,
TYPE_CHECKING, Tuple, Type, TypeVar, Union, cast)
-from git.types import Has_id_attribute, Literal, Protocol, runtime_checkable
+from git.types import Has_id_attribute, Literal
if TYPE_CHECKING:
from io import BytesIO, StringIO
@@ -35,6 +35,12 @@ if TYPE_CHECKING:
from .tree import Tree, TraversedTreeTup
from subprocess import Popen
from .submodule.base import Submodule
+ from git.types import Protocol, runtime_checkable
+else:
+ Protocol = Generic
+
+ def runtime_checkable(f):
+ return f
class TraverseNT(NamedTuple):