We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e76b537 + cfa3782 commit 572bbb3Copy full SHA for 572bbb3
git/util.py
@@ -381,13 +381,10 @@ def expand_path(p: PathLike, expand_vars: bool = ...) -> str:
381
382
def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[str]:
383
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
+ p = osp.expanduser(p) # type: ignore
+ if expand_vars:
+ p = osp.expandvars(p) # type: ignore
+ return osp.normpath(osp.abspath(p)) # type: ignore
391
except Exception:
392
return None
393
0 commit comments