From 3a3104109beddde0876eb4dc108b5ca5aba811ce 2020-09-14 22:24:26 From: Matthias Bussonnier Date: 2020-09-14 22:24:26 Subject: [PATCH] Update IPython/core/interactiveshell.py --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index b30853a..d35f5cb 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -920,10 +920,10 @@ class InteractiveShell(SingletonConfigurable): paths.append(p.resolve()) # In Cygwin paths like "c:\..." and '\cygdrive\c\...' are possible - if p_venv.startswith('\\cygdrive'): - p_venv = p_venv[11:] - elif len(p_venv) >= 2 and p_venv[1] == ':': - p_venv = p_venv[2:] + if str(p_venv).startswith('\\cygdrive'): + p_venv = Path(str(p_venv)[11:]) + elif len(str(p_venv)) >= 2 and str(p_venv)[1] == ':': + p_venv = Path(str(p_venv)[2:]) if any(os.fspath(p_venv) in os.fspath(p) for p in paths): # Our exe is inside or has access to the virtualenv, don't need to do anything.