summaryrefslogtreecommitdiff
path: root/ez_setup.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-09-06 18:14:34 +0000
committerPJ Eby <distutils-sig@python.org>2006-09-06 18:14:34 +0000
commit346215d9cf66fa98203fa4cb803f2d60f6798c07 (patch)
treec285951f07397f7c65649223b234328ddceaa71d /ez_setup.py
parentc63bb77e4ccbeee217aeafca3a8b0efc812f8d82 (diff)
downloadpython-setuptools-git-346215d9cf66fa98203fa4cb803f2d60f6798c07.tar.gz
Support setuptools .egg being in current directory when bootstrapping on
an offline machine. Output what version/location is conflicting when a newer version of setuptools is requested. --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4051778
Diffstat (limited to 'ez_setup.py')
-rwxr-xr-xez_setup.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ez_setup.py b/ez_setup.py
index adf4eeec..e58c6f6b 100755
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -77,13 +77,13 @@ def use_setuptools(
try:
pkg_resources.require("setuptools>="+version)
- except pkg_resources.VersionConflict:
+ except pkg_resources.VersionConflict, e:
# XXX could we install in a subprocess here?
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available, and\n"
"can't be installed while this script is running. Please install\n"
- " a more recent version first."
- ) % version
+ " a more recent version first.\n\n(Currently using %r)"
+ ) % (version, e.args[0])
sys.exit(2)
def download_setuptools(
@@ -139,15 +139,15 @@ def main(argv, version=DEFAULT_VERSION):
try:
import setuptools
except ImportError:
- import tempfile, shutil
- tmpdir = tempfile.mkdtemp(prefix="easy_install-")
+ egg = None
try:
- egg = download_setuptools(version, to_dir=tmpdir, delay=0)
+ egg = download_setuptools(version, delay=0)
sys.path.insert(0,egg)
from setuptools.command.easy_install import main
return main(list(argv)+[egg]) # we're done here
finally:
- shutil.rmtree(tmpdir)
+ if egg and os.path.exists(egg):
+ os.unlink(egg)
else:
if setuptools.__version__ == '0.0.1':
# tell the user to uninstall obsolete version