diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-24 16:10:52 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-24 16:10:52 -0500 |
commit | aa90fa16d02e956b87e0a892683f0ba2e9ecdc03 (patch) | |
tree | aad2caf1dd37206b0caa6930f222f39c78d55061 /ez_setup.py | |
parent | ba268e837c5fd269c9030c28d85fff6423c1bdec (diff) | |
download | external_python_setuptools-aa90fa16d02e956b87e0a892683f0ba2e9ecdc03.tar.gz external_python_setuptools-aa90fa16d02e956b87e0a892683f0ba2e9ecdc03.tar.bz2 external_python_setuptools-aa90fa16d02e956b87e0a892683f0ba2e9ecdc03.zip |
Use modern syntax for exception handling in ez_setup.py. This change will also prevent Python 2.4 and Python 2.5 users from invoking it.
Diffstat (limited to 'ez_setup.py')
-rw-r--r-- | ez_setup.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ez_setup.py b/ez_setup.py index 3c39ab43..147ab14d 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -135,7 +135,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, return except pkg_resources.DistributionNotFound: return _do_download(version, download_base, to_dir, download_delay) - except pkg_resources.VersionConflict: + except pkg_resources.VersionConflict as VC_err: if was_imported: msg = textwrap.dedent(""" The required version of setuptools (>={version}) is not available, @@ -144,7 +144,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, 'easy_install -U setuptools'. (Currently using {VC_err.args[0]!r}) - """).format(VC_err = sys.exc_info()[1], version=version) + """).format(VC_err=VC_err, version=version) sys.stderr.write(msg) sys.exit(2) @@ -325,8 +325,7 @@ def _extractall(self, path=".", members=None): self.chown(tarinfo, dirpath) self.utime(tarinfo, dirpath) self.chmod(tarinfo, dirpath) - except ExtractError: - e = sys.exc_info()[1] + except ExtractError as e: if self.errorlevel > 1: raise else: |