ipython/ipython — pull request #4218 by takluyver (2013-09-16 19:55:11+00:00)
Title: Fix display of SyntaxError when .py file is modified

As described on the mailing list, the line displayed with a SyntaxError can be incorrect, when editing and rerunning a file, due to stale caching. The line appears to be retrieved from the cache when the SyntaxError is created, which we can't influence, but we can replace it before we display the error, which is what this does.