diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-09 22:53:38 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-09 22:53:38 -0400 |
| commit | b383fe311089ed6488916614acbf085521c12e48 (patch) | |
| tree | 707db8849b101262e7ba6d3bac5e530d0f8178b4 /pkg_resources.py | |
| parent | 4b432e0f50e9f5871a2f7375b406be7258bfa22c (diff) | |
| download | python-setuptools-git-b383fe311089ed6488916614acbf085521c12e48.tar.gz | |
Replaced overly-specific error messages with more general ones for improved cross-implementation compatibility. Fixes #50.
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 7c3bdccd..5514a099 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1271,9 +1271,15 @@ def normalize_exception(exc): """ Given a SyntaxError from a marker evaluation, normalize the error message: - Remove indications of filename and line number. + - Replace platform-specific error messages with standard error messages. """ + subs = { + 'unexpected EOF while parsing': 'invalid syntax', + 'parenthesis is never closed': 'invalid syntax', + } exc.filename = None exc.lineno = None + exc.msg = subs.get(exc.msg, exc.msg) return exc |
