Skip to content

Commit

Permalink
Merge remote-tracking branch 'TC01/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Jun 6, 2012
2 parents 1a9a97b + b251709 commit c16eee4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pip/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,16 @@ def virtualenv_no_global():
build_prefix = os.path.join(sys.prefix, 'build')
src_prefix = os.path.join(sys.prefix, 'src')
else:
#Use tempfile to create a temporary folder
build_prefix = tempfile.mkdtemp('-build', 'pip-')
src_prefix = tempfile.mkdtemp('-src', 'pip-')
## FIXME: this is a terrible hack; change req.py (or other locations?)
## to flag a directory for deletion based on whether or not it matches
## build_prefix and src_prefix, NOT if pip has had to create it
# Use tempfile to create a temporary folder for build
# Note: we are NOT using mkdtemp so we can have a consistent build dir
build_prefix = os.path.join(tempfile.gettempdir(), 'pip-build')

## FIXME: keep src in cwd for now (it is not a temporary folder)
try:
os.rmdir(build_prefix)
os.rmdir(src_prefix)
src_prefix = os.path.join(os.getcwd(), 'src')
except OSError:
# I'm not sure why this wouldn't work, but just in case!
sys.exit("An error has occurred in attempting to set up the temporary directories")
# In case the current working directory has been renamed or deleted
sys.exit("The folder you are executing pip from can no longer be found.")

# under Mac OS X + virtualenv sys.prefix is not properly resolved
# it is something like /path/to/python/bin/..
Expand Down

0 comments on commit c16eee4

Please sign in to comment.