Serhiy Storchaka added the comment:

The traceback contain the location of the code that raised an exception when 
executed. In case of NameError this is a line in your script "x=u". In case of 
SyntaxError the code that failed is not in your script (it still is not 
executed), but in a compiler implicitly called by exec(). The line with exec() 
is correctly reported.

The behavior looks correct to me.

----------
nosy: +serhiy.storchaka

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

Reply via email to