1. dready
  2. pip


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
  • Branches default

Comments (0)

Files changed (3)

File pip/locations.py

View file
 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')

File pip/req.py

View file
 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
                 '--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',

File pip/util.py

View file
-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))