aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-04 11:35:16 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-04 11:35:16 -0500
commit9d6a6e5927ae0e67164383e419f3145fc154467e (patch)
tree8872d8b6de4c8706a5178dcb3dab2c9803216e59 /pkg_resources
parenta849ee957f3ba12945278f88e473eb3612faf4b9 (diff)
downloadexternal_python_setuptools-9d6a6e5927ae0e67164383e419f3145fc154467e.tar.gz
external_python_setuptools-9d6a6e5927ae0e67164383e419f3145fc154467e.tar.bz2
external_python_setuptools-9d6a6e5927ae0e67164383e419f3145fc154467e.zip
Use except/as, now supported by Python 2.6
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index f004315a..41d3eb38 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -843,8 +843,7 @@ class WorkingSet(object):
try:
resolvees = shadow_set.resolve(req, env, installer)
- except ResolutionError:
- v = sys.exc_info()[1]
+ except ResolutionError as v:
# save error info
error_info[dist] = v
if fallback:
@@ -1340,8 +1339,8 @@ class MarkerEvaluation(object):
"""
try:
cls.evaluate_marker(text)
- except SyntaxError:
- return cls.normalize_exception(sys.exc_info()[1])
+ except SyntaxError as e:
+ return cls.normalize_exception(e)
return False
@staticmethod
@@ -1456,8 +1455,7 @@ class MarkerEvaluation(object):
env[new_key] = env.pop(key)
try:
result = _markerlib.interpret(text, env)
- except NameError:
- e = sys.exc_info()[1]
+ except NameError as e:
raise SyntaxError(e.args[0])
return result