Commits

Wouter Vanden Hove committed cd6b8b3

Improve reliable checking if we are already in a virtualenv.

  • Participants
  • Parent commits 90c4680

Comments (0)

Files changed (2)

 0.9 (unreleased)
 ----------------
 
+- Improve reliable checking if we are already in a virtualenv.
+  [WouterVH]
+
 - The venv_options were not passed correctly to virtualenv.
   [WouterVH]
 

rjm/recipe/venv/__init__.py

             cfgval = self.options.get('venv_options')
             cfgval = cfgval.strip().split()
 
-        # make the venv? (XXX: is this test too weak)
-        is_venv = os.path.exists(venv_python_path)
+        is_venv = hasattr(sys, 'real_prefix')
         if not is_venv:
             venv_file = virtualenv.__file__
             if venv_file[-4:] in ('.pyc', '.pyo'):