summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
authorDominic <yobmod@gmail.com>2021-08-03 16:40:48 +0100
committerGitHub <noreply@github.com>2021-08-03 16:40:48 +0100
commitfe54118ec07a68d5dc6f6108510cffc55dfca643 (patch)
tree3025974ca54ef607ee3d4660da4dc242e184f8ea /git/util.py
parentd8a639865d02a6bb3f93a233d3caa928d18bc622 (diff)
parent84232f7c71e41e56636f203eb26763a03ab6e945 (diff)
downloadgitpython-fe54118ec07a68d5dc6f6108510cffc55dfca643.tar.gz
Merge pull request #1311 from Yobmod/main
Drop 3.6, increase type strictness
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/git/util.py b/git/util.py
index 92d95379..4f82219e 100644
--- a/git/util.py
+++ b/git/util.py
@@ -38,6 +38,7 @@ if TYPE_CHECKING:
from git.remote import Remote
from git.repo.base import Repo
from git.config import GitConfigParser, SectionConstraint
+ from git import Git
# from git.objects.base import IndexObject
@@ -69,7 +70,7 @@ from gitdb.util import ( # NOQA @IgnorePep8
# Most of these are unused here, but are for use by git-python modules so these
# don't see gitdb all the time. Flake of course doesn't like it.
__all__ = ["stream_copy", "join_path", "to_native_path_linux",
- "join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList",
+ "join_path_native", "Stats", "IndexFileSHA1Writer", "IterableObj", "IterableList",
"BlockingLockFile", "LockFile", 'Actor', 'get_user_id', 'assure_directory_exists',
'RemoteProgress', 'CallableRemoteProgress', 'rmtree', 'unbare_repo',
'HIDE_WINDOWS_KNOWN_ERRORS']
@@ -379,7 +380,7 @@ def get_user_id() -> str:
return "%s@%s" % (getpass.getuser(), platform.node())
-def finalize_process(proc: subprocess.Popen, **kwargs: Any) -> None:
+def finalize_process(proc: Union[subprocess.Popen, 'Git.AutoInterrupt'], **kwargs: Any) -> None:
"""Wait for the process (clone, fetch, pull or push) and handle its errors accordingly"""
# TODO: No close proc-streams??
proc.wait(**kwargs)
@@ -403,7 +404,7 @@ def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[
p = osp.expanduser(p) # type: ignore
if expand_vars:
p = osp.expandvars(p) # type: ignore
- return osp.normpath(osp.abspath(p)) # type: ignore
+ return osp.normpath(osp.abspath(p)) # type: ignore
except Exception:
return None
@@ -1033,7 +1034,7 @@ class IterableList(List[T_IterableObj]):
class IterableClassWatcher(type):
""" Metaclass that watches """
- def __init__(cls, name: str, bases: List, clsdict: Dict) -> None:
+ def __init__(cls, name: str, bases: Tuple, clsdict: Dict) -> None:
for base in bases:
if type(base) == IterableClassWatcher:
warnings.warn(f"GitPython Iterable subclassed by {name}. "