diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-24 15:51:03 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-24 15:51:03 -0500 |
commit | 85e1c4f71cbc256ce0337ed775aacd3635e8ce5d (patch) | |
tree | 0e157c496025d195dac377c60ca67860c580db26 /ez_setup.py | |
parent | dfd8cf27fae82862038a4961107702f345c526ec (diff) | |
download | external_python_setuptools-85e1c4f71cbc256ce0337ed775aacd3635e8ce5d.tar.gz external_python_setuptools-85e1c4f71cbc256ce0337ed775aacd3635e8ce5d.tar.bz2 external_python_setuptools-85e1c4f71cbc256ce0337ed775aacd3635e8ce5d.zip |
Use textwrap.dedent for multiline string. Use new style string formatter.
Diffstat (limited to 'ez_setup.py')
-rw-r--r-- | ez_setup.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ez_setup.py b/ez_setup.py index a6f48158..c38e96e5 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -21,6 +21,7 @@ import tarfile import optparse import subprocess import platform +import textwrap from distutils import log @@ -134,14 +135,16 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, pkg_resources.require("setuptools>=" + version) return except pkg_resources.VersionConflict: - e = sys.exc_info()[1] if was_imported: - sys.stderr.write( - "The required version of setuptools (>=%s) is not available,\n" - "and can't be installed while this script is running. Please\n" - "install a more recent version first, using\n" - "'easy_install -U setuptools'." - "\n\n(Currently using %r)\n" % (version, e.args[0])) + msg = textwrap.dedent(""" + The required version of setuptools (>={version}) is not available, + and can't be installed while this script is running. Please + install a more recent version first, using + 'easy_install -U setuptools'. + + (Currently using {VC_err.args[0]!r}) + """).format(VC_err = sys.exc_info()[1], version=version) + sys.stderr.write(msg) sys.exit(2) else: del pkg_resources, sys.modules['pkg_resources'] # reload ok |