mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #3843 from pypa/resolve-symlink
Make sure symlinks are resolved.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Resolve the symlinks when the path is absolute.
|
||||
+4
-5
@@ -47,11 +47,10 @@ def _normalized(p):
|
||||
if p is None:
|
||||
return None
|
||||
loc = vistir.compat.Path(p)
|
||||
if not loc.is_absolute():
|
||||
try:
|
||||
loc = loc.resolve()
|
||||
except OSError:
|
||||
loc = loc.absolute()
|
||||
try:
|
||||
loc = loc.resolve()
|
||||
except OSError:
|
||||
loc = loc.absolute()
|
||||
# Recase the path properly on Windows. From https://stackoverflow.com/a/35229734/5043728
|
||||
if os.name == 'nt':
|
||||
matches = glob.glob(re.sub(r'([^:/\\])(?=[/\\]|$)', r'[\1]', str(loc)))
|
||||
|
||||
Reference in New Issue
Block a user