Skip to content

Commit 1af4ff4

Browse files
Carreaumeeseeksmachine
authored andcommitted
Backport PR ipython#14640: Fixed bug with a warning message incorrectly displayed
1 parent cc014ab commit 1af4ff4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IPython/core/interactiveshell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def init_virtualenv(self):
900900
return
901901

902902
p = Path(sys.executable)
903-
p_venv = Path(os.environ["VIRTUAL_ENV"])
903+
p_venv = Path(os.environ["VIRTUAL_ENV"]).resolve()
904904

905905
# fallback venv detection:
906906
# stdlib venv may symlink sys.executable, so we can't use realpath.
@@ -913,7 +913,7 @@ def init_virtualenv(self):
913913
drive_name = p_venv.parts[2]
914914
p_venv = (drive_name + ":/") / Path(*p_venv.parts[3:])
915915

916-
if any(p_venv == p.parents[1] for p in paths):
916+
if any(p_venv == p.parents[1].resolve() for p in paths):
917917
# Our exe is inside or has access to the virtualenv, don't need to do anything.
918918
return
919919

0 commit comments

Comments
 (0)