Make parse errors meaningful.

This makes the error displays on a bad setup.cfg value go from:

error in setup command: Error parsing setup.cfg: IOError: 2

to

error in setup command: Error parsing setup.cfg: IOError: No such file or
directory: 'README'

Which makes debugging eversomuch better.
This commit is contained in:
Monty Taylor 2013-05-13 10:14:11 -04:00
parent 0d335d0804
commit 5d0e256f4b

View File

@ -47,8 +47,7 @@ def d2to1(dist, attr, value):
except:
e = sys.exc_info()[1]
raise DistutilsSetupError(
'Error parsing %s: %s: %s' % (path, e.__class__.__name__,
e.args[0]))
'Error parsing %s: %s: %s' % (path, e.__class__.__name__, e))
# Repeat some of the Distribution initialization code with the newly
# provided attrs