summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2021-08-03 17:06:31 +0100
committerGitHub <noreply@github.com>2021-08-03 17:06:31 +0100
commit05c77cf06e82f7932fb9775fad74251ad6c8aa4f (patch)
tree2491f8abc76300493fc80251fa21a967db48c375 /git/util.py
parent335e59dc2cece491a5c5d42396ce70d4ed0715b5 (diff)
parent0b89bfe855f0faadf359efcfad8ae752d98c6032 (diff)
downloadgitpython-05c77cf06e82f7932fb9775fad74251ad6c8aa4f.tar.gz
Merge branch 'main' into patch-1
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 84d0b015..4463b092 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
@@ -1037,7 +1038,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}. "