Hugo Lopes Tavares avatar Hugo Lopes Tavares committed 4bbf940

removed circular import. moved running_under_virtualenv to pip.locations and updated imports

Comments (0)

Files changed (3)

 import sys
 import os
 from distutils import sysconfig
-from pip.util import running_under_virtualenv
+
+
+def running_under_virtualenv():
+    """
+    Return True if we're running inside a virtualenv, False otherwise.
+
+    """
+    return hasattr(sys, 'real_prefix')
 
 
 if running_under_virtualenv():
 import ConfigParser
 from distutils.sysconfig import get_python_version
 from email.FeedParser import FeedParser
-from pip.locations import bin_py
+from pip.locations import bin_py, running_under_virtualenv
 from pip.exceptions import InstallationError, UninstallationError
 from pip.vcs import vcs
 from pip.log import logger
 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 running_under_virtualenv, geturl
+from pip.util import geturl
 from pip import call_subprocess
 from pip.backwardcompat import any, md5, copytree
 from pip.index import Link
 
 from pip.backwardcompat import WindowsError
 from pip.exceptions import InstallationError
-from pip.locations import site_packages
+from pip.locations import site_packages, running_under_virtualenv
 
 __all__ = ['rmtree', 'display_path', 'backup_dir',
            'find_command', 'splitext', 'ask', 'Inf',
             pass
 
 
-def running_under_virtualenv():
-    """
-    Return True if we're running inside a virtualenv, False otherwise.
-
-    """
-    return hasattr(sys, 'real_prefix')
-
-
 def is_local(path):
     """
     Return True if path is within sys.prefix, if we're running in a virtualenv.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.