Skip to content

Commit

Permalink
Fix for embedded shell venv check index error (#14440)
Browse files Browse the repository at this point in the history
Fixes the issue from #14126 where we get an index out of range error
when VIRTUAL_ENV is set to a 1 or 2 part path (eg ".venv").
  • Loading branch information
Carreau committed May 27, 2024
2 parents 43781b3 + 269297b commit fd05a9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def init_virtualenv(self):
paths = self.get_path_links(p)

# In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible
if p_venv.parts[1] == "cygdrive":
if len(p_venv.parts) > 2 and p_venv.parts[1] == "cygdrive":
drive_name = p_venv.parts[2]
p_venv = (drive_name + ":/") / Path(*p_venv.parts[3:])

Expand Down

0 comments on commit fd05a9a

Please sign in to comment.