GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Address review feedback and restore CI compatibility · gitpython-developers/GitPython@ccc8f2b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • git
    • cmd.py
    • util.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/cmd.py‎

Copy file name to clipboardExpand all lines: git/cmd.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ def execute(
13581358

13591359
# Allow the user to have the command executed in their working dir.
13601360
try:
1361-
cwd = self._working_dir or os.getcwd() # type: Union[None, str]
1361+
cwd = self._working_dir or os.getcwd() # type: Optional[PathLike]
13621362
if not os.access(str(cwd), os.X_OK):
13631363
cwd = None
13641364
except FileNotFoundError:
Collapse file

‎git/util.py‎

Copy file name to clipboardExpand all lines: git/util.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106

107107
# ---------------------------------------------------------------------
108108

109-
T_IterableObj = TypeVar("T_IterableObj", bound=Union["IterableObj", "Has_id_attribute"])
109+
T_IterableObj = TypeVar("T_IterableObj", bound=Union["IterableObj", "Has_id_attribute"], covariant=True)
110110
# So IterableList[Head] is subtype of IterableList[IterableObj].
111111

112112
_logger = logging.getLogger(__name__)
@@ -217,7 +217,7 @@ def rmtree(path: PathLike) -> None:
217217
couldn't be deleted are read-only. Windows will not remove them in that case.
218218
"""
219219

220-
def handler(function: Callable[[PathLike], Any], path: PathLike, _excinfo: Any) -> None:
220+
def handler(function: Callable[[str], Any], path: str, _excinfo: Any) -> None:
221221
"""Callback for :func:`shutil.rmtree`.
222222
223223
This works as either a ``onexc`` or ``onerror`` style callback.
@@ -508,7 +508,7 @@ def get_user_id() -> str:
508508
return "%s@%s" % (getpass.getuser(), platform.node())
509509

510510

511-
def finalize_process(proc: Union[subprocess.Popen[Any], "Git.AutoInterrupt"], **kwargs: Any) -> None:
511+
def finalize_process(proc: Union["subprocess.Popen[Any]", "Git.AutoInterrupt"], **kwargs: Any) -> None:
512512
"""Wait for the process (clone, fetch, pull or push) and handle its errors
513513
accordingly."""
514514
# TODO: No close proc-streams??
@@ -520,17 +520,17 @@ def expand_path(p: None, expand_vars: bool = ...) -> None: ...
520520

521521

522522
@overload
523-
def expand_path(p: PathLike, expand_vars: bool = ...) -> str:
523+
def expand_path(p: PathLike, expand_vars: bool = ...) -> Optional[PathLike]:
524524
# TODO: Support for Python 3.5 has been dropped, so these overloads can be improved.
525525
...
526526

527527

528528
def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[PathLike]:
529529
if p is None:
530530
return None
531-
if isinstance(p, Path):
532-
return p.resolve()
533531
try:
532+
if isinstance(p, Path):
533+
return p.resolve()
534534
expanded_path = osp.expanduser(os.fspath(p))
535535
if expand_vars:
536536
expanded_path = osp.expandvars(expanded_path)
@@ -986,7 +986,7 @@ class IndexFileSHA1Writer:
986986

987987
__slots__ = ("f", "sha1")
988988

989-
def __init__(self, f: BinaryIO) -> None:
989+
def __init__(self, f: IO[bytes]) -> None:
990990
self.f = f
991991
self.sha1 = make_sha(b"")
992992

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.