Skip to content

Commit

Permalink
Merge pull request #903 from qwcode/home_lib
Browse files Browse the repository at this point in the history
improve method for getting home scheme purelib
  • Loading branch information
qwcode committed Apr 20, 2013
2 parents 5b3a6e9 + fd933a9 commit acc9172
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 0 additions & 9 deletions pip/backwardcompat/__init__.py
Expand Up @@ -118,15 +118,6 @@ def product(*args, **kwds):
yield tuple(prod)


def home_lib(home):
"""Return the lib dir under the 'home' installation scheme"""
if hasattr(sys, 'pypy_version_info'):
lib = 'site-packages'
else:
lib = os.path.join('lib', 'python')
return os.path.join(home, lib)


## only >=py32 has ssl.match_hostname and ssl.CertificateError
try:
from ssl import match_hostname, CertificateError
Expand Down
5 changes: 2 additions & 3 deletions pip/commands/install.py
Expand Up @@ -4,11 +4,10 @@
import shutil
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.log import logger
from pip.locations import src_prefix, virtualenv_no_global
from pip.locations import src_prefix, virtualenv_no_global, distutils_scheme
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions import InstallationError, CommandError
from pip.backwardcompat import home_lib
from pip import cmdoptions


Expand Down Expand Up @@ -256,7 +255,7 @@ def run(self, options, args):
if options.target_dir:
if not os.path.exists(options.target_dir):
os.makedirs(options.target_dir)
lib_dir = home_lib(temp_target_dir)
lib_dir = distutils_scheme('', home=temp_target_dir)['purelib']
for item in os.listdir(lib_dir):
shutil.move(
os.path.join(lib_dir, item),
Expand Down

0 comments on commit acc9172

Please sign in to comment.