From 4c8ac16ec07398f4312ef93b29a7043685166ead Mon Sep 17 00:00:00 2001 From: Marcus Smith Date: Mon, 19 Nov 2012 09:38:20 -0800 Subject: [PATCH] patch dist_in_site_packages for user_site tests --- pip/req.py | 6 ++---- tests/test_user_site.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pip/req.py b/pip/req.py index b7dc939fa7d..8976a563271 100644 --- a/pip/req.py +++ b/pip/req.py @@ -8,8 +8,6 @@ import tempfile import zipfile -import pip - from distutils.util import change_root from pip.locations import bin_py, running_under_virtualenv from pip.exceptions import (InstallationError, UninstallationError, @@ -19,7 +17,7 @@ from pip.log import logger from pip.util import display_path, rmtree from pip.util import ask, ask_path_exists, backup_dir -from pip.util import is_installable_dir, is_local, dist_is_local, dist_in_usersite +from pip.util import is_installable_dir, is_local, dist_is_local, dist_in_usersite, dist_in_site_packages from pip.util import renames, normalize_path, egg_link_path from pip.util import make_path_relative from pip.util import call_subprocess @@ -694,7 +692,7 @@ def check_if_exists(self): if self.use_user_site: if dist_in_usersite(existing_dist): self.conflicts_with = existing_dist - elif running_under_virtualenv() and pip.util.dist_in_site_packages(existing_dist): + elif running_under_virtualenv() and dist_in_site_packages(existing_dist): raise InstallationError("Will not install to the user site because it will lack sys.path precedence to %s in %s" %(existing_dist.project_name, existing_dist.location)) else: diff --git a/tests/test_user_site.py b/tests/test_user_site.py index e4f5c73a8f5..eaba041cf74 100644 --- a/tests/test_user_site.py +++ b/tests/test_user_site.py @@ -12,8 +12,8 @@ patch_dist_in_site_packages = """ def dist_in_site_packages(dist): return False - import pip - pip.util.dist_in_site_packages=dist_in_site_packages + from pip import req + req.dist_in_site_packages=dist_in_site_packages """