summaryrefslogtreecommitdiff
path: root/git/objects/util.py
diff options
context:
space:
mode:
authorDominic <yobmod@gmail.com>2021-09-09 19:49:13 +0100
committerGitHub <noreply@github.com>2021-09-09 19:49:13 +0100
commitcfcae1d839c5dbb94745c504993c9d5baebc44b5 (patch)
tree2227e4e6931ad38e1a3c5a2c48cecbf5d57e5f01 /git/objects/util.py
parent5da76e8b4466459a3b6a400c4750a622879acce8 (diff)
parentbb9b50ff2671cda598ff19653d3de49e03b6d163 (diff)
downloadgitpython-cfcae1d839c5dbb94745c504993c9d5baebc44b5.tar.gz
Merge pull request #1318 from Yobmod/main
General fixes for next release
Diffstat (limited to 'git/objects/util.py')
-rw-r--r--git/objects/util.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/git/objects/util.py b/git/objects/util.py
index 16d4c0ac..187318fe 100644
--- a/git/objects/util.py
+++ b/git/objects/util.py
@@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
"""Module for general utility functions"""
-from abc import abstractmethod
+from abc import ABC, abstractmethod
import warnings
from git.util import (
IterableList,
@@ -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, # NOQA: F401
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, _T # NOQA: F401
if TYPE_CHECKING:
from io import BytesIO, StringIO
@@ -35,6 +35,13 @@ 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[_T] # NNeeded for typing bug #572?
+ Protocol = ABC
+
+ def runtime_checkable(f):
+ return f
class TraverseNT(NamedTuple):