Skip to content

Commit

Permalink
Resolve symlinks and store as p to avoid infinite loop. Fixes ipython…
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Oct 15, 2021
1 parent 98941e5 commit 242d7b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,8 @@ def init_virtualenv(self):
# So we just check every item in the symlink tree (generally <= 3)
paths = [p]
while p.is_symlink():
p = Path(os.readlink(p))
paths.append(p.resolve())
p = Path(os.readlink(p)).resolve()
paths.append(p)

# In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
if p_venv.parts[1] == "cygdrive":
Expand Down

0 comments on commit 242d7b6

Please sign in to comment.