mirror of https://github.com/pypa/pip
Add resolve_symlinks arg to normalize_path()
This commit is contained in:
parent
09f2b343e9
commit
7e9a42dcda
|
@ -47,7 +47,7 @@ class UninstallPathSet(object):
|
|||
return True
|
||||
|
||||
def add(self, path):
|
||||
path = os.path.normcase(os.path.expanduser(path))
|
||||
path = normalize_path(path, resolve_symlinks=False)
|
||||
if not os.path.exists(path):
|
||||
return
|
||||
if self._permitted(path):
|
||||
|
|
|
@ -260,12 +260,15 @@ def make_path_relative(path, rel_to):
|
|||
return os.path.sep.join(full_parts)
|
||||
|
||||
|
||||
def normalize_path(path):
|
||||
def normalize_path(path, resolve_symlinks=True):
|
||||
"""
|
||||
Convert a path to its canonical, case-normalized, absolute version.
|
||||
|
||||
"""
|
||||
return os.path.normcase(os.path.realpath(os.path.expanduser(path)))
|
||||
path = os.path.expanduser(path)
|
||||
if resolve_symlinks:
|
||||
path = os.path.realpath(path)
|
||||
return os.path.normcase(path)
|
||||
|
||||
|
||||
def splitext(path):
|
||||
|
|
Loading…
Reference in New Issue