Nick Coghlan added the comment:

Heuristic based approach that just does a fairly simple check for the syntax 
error text starting with "print " or "exec " when the text doesn't contain a 
left parenthesis.

This will still miss a few cases where the left parenthesis is inside a larger 
expression (like a string, list or dict), but that extra check avoids false 
triggering on cases like "print (a.)".

----------
Added file: 
http://bugs.python.org/file35497/issue21669_custom_error_messages.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21669>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to