From 19bb2609a8943698f20fefd77e54e51153df2294 2014-08-05 15:15:41 From: Eric Galloway Date: 2014-08-05 15:15:41 Subject: [PATCH] Add local variable for normalized virtualenv path --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index eb0432b..7d7d0fe 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -741,7 +741,8 @@ class InteractiveShell(SingletonConfigurable): while os.path.islink(p): p = os.path.normcase(os.path.join(os.path.dirname(p), os.readlink(p))) paths.append(p) - if any(p.startswith(os.path.normcase(os.environ['VIRTUAL_ENV'])) for p in paths): + p_venv = os.path.normcase(os.environ['VIRTUAL_ENV']) + if any(p.startswith(p_venv) for p in paths): # Running properly in the virtualenv, don't need to do anything return