8000 Merge pull request #1240 from Yobmod/addtypes · NagiReddy-devops/GitPython@572bbb3 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 572bbb3

Browse files
authored
Merge pull request gitpython-developers#1240 from Yobmod/addtypes
revert util.expand_path() due to regression
2 parents e76b537 + cfa3782 commit 572bbb3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

git/util.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,10 @@ def expand_path(p: PathLike, expand_vars: bool = ...) -> str:
381381

382382
def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[str]:
383383
try:
384-
if p is not None:
385-
p_out = osp.expanduser(p)
386-
if expand_vars:
387-
p_out = osp.expandvars(p_out)
388-
return osp.normpath(osp.abspath(p_out))
389-
else:
390-
return None
384+
p = osp.expanduser(p) # type: ignore
385+
if expand_vars:
386+
p = osp.expandvars(p) # type: ignore
387+
return osp.normpath(osp.abspath(p)) # type: ignore
391388
except Exception:
392389
return None
393390

0 commit comments

Comments
 (0)
0