We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96c4365 commit cfa3782Copy full SHA for cfa3782
git/util.py
@@ -382,13 +382,10 @@ def expand_path(p: PathLike, expand_vars: bool = ...) -> str:
382
383
def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[str]:
384
try:
385
- if p is not None:
386
- p_out = osp.expanduser(p)
387
- if expand_vars:
388
- p_out = osp.expandvars(p_out)
389
- return osp.normpath(osp.abspath(p_out))
390
- else:
391
- 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
392
except Exception:
393
return None
394
0 commit comments