summaryrefslogtreecommitdiff
path: root/pkg_resources.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py6
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