Commits

Hugo Lopes Tavares committed c389429

removed _running_under_virtualenv defined in locations.py, and renamed pip.util.in_venv to pip.util.running_under_virtualenv

  • Participants
  • Parent commits 17c2cc2

Comments (0)

Files changed (3)

File pip/locations.py

 import sys
 import os
 from distutils import sysconfig
+from pip.util import running_under_virtualenv
 
 
-def _running_under_virtualenv():
-    return hasattr(sys, 'real_prefix')
-
-
-if _running_under_virtualenv():
+if running_under_virtualenv():
     ## FIXME: is build/ a good name?
     build_prefix = os.path.join(sys.prefix, 'build')
     src_prefix = os.path.join(sys.prefix, 'src')
 from pip.util import make_path_relative, is_svn_page, file_contents
 from pip.util import has_leading_dir, split_leading_dir
 from pip.util import get_file_content
-from pip.util import in_venv, geturl
+from pip.util import running_under_virtualenv, geturl
 from pip import call_subprocess
 from pip.backwardcompat import any, md5, copytree
 from pip.index import Link
                 '--single-version-externally-managed',
                 '--record', record_filename]
 
-            if in_venv():
+            if running_under_virtualenv():
                 ## FIXME: I'm not sure if this is a reasonable location; probably not
                 ## but we can't put it in the default location, as that is a virtualenv symlink that isn't writable
                 install_args += ['--install-headers',
             pass
 
 
-def in_venv():
+def running_under_virtualenv():
     """
     Return True if we're running inside a virtualenv, False otherwise.
 
     If we're not in a virtualenv, all paths are considered "local."
 
     """
-    if not in_venv():
+    if not running_under_virtualenv():
         return True
     return normalize_path(path).startswith(normalize_path(sys.prefix))