mirror of
https://github.com/python/cpython.git
synced 2025-11-27 13:45:25 +00:00
Remove tabs introduced in last commit.
This commit is contained in:
parent
3f7cb5d9f5
commit
dfa5d95613
1 changed files with 4 additions and 4 deletions
|
|
@ -406,7 +406,7 @@ symbolic links encountered in the path."""
|
||||||
for i in range(2, len(bits)+1):
|
for i in range(2, len(bits)+1):
|
||||||
component = join(*bits[0:i])
|
component = join(*bits[0:i])
|
||||||
# Resolve symbolic links.
|
# Resolve symbolic links.
|
||||||
if islink(component):
|
if islink(component):
|
||||||
resolved = _resolve_link(component)
|
resolved = _resolve_link(component)
|
||||||
if resolved is None:
|
if resolved is None:
|
||||||
# Infinite loop -- return original component + rest of the path
|
# Infinite loop -- return original component + rest of the path
|
||||||
|
|
@ -425,12 +425,12 @@ def _resolve_link(path):
|
||||||
"""
|
"""
|
||||||
paths_seen = []
|
paths_seen = []
|
||||||
while islink(path):
|
while islink(path):
|
||||||
if path in paths_seen:
|
if path in paths_seen:
|
||||||
# Already seen this path, so we must have a symlink loop
|
# Already seen this path, so we must have a symlink loop
|
||||||
return None
|
return None
|
||||||
paths_seen.append(path)
|
paths_seen.append(path)
|
||||||
# Resolve where the link points to
|
# Resolve where the link points to
|
||||||
resolved = os.readlink(path)
|
resolved = os.readlink(path)
|
||||||
if not abspath(resolved):
|
if not abspath(resolved):
|
||||||
dir = dirname(path)
|
dir = dirname(path)
|
||||||
path = normpath(join(dir, resolved))
|
path = normpath(join(dir, resolved))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue