Andre Roberge <andre.robe...@gmail.com> added the comment:

Would it be possible to add a single line of code to idlelib's pyshell.py, as 
indicated below:

def showsyntaxerror(self, filename=None):
    """... """
    linecache.cache["<SyntaxError>"] = linecache.cache[filename]  # here
    tkconsole = self.tkconsole
    ...

Of course, another name than "<SyntaxError>" could be chosen.

This would allow users (like me, with Friendly) to retrieve the code that 
caused a SyntaxError and process it as they wish. In my case, it would allow me 
to reproduce the SyntaxError and have Friendly provide an explanation and 
possible suggestions for fixing the error.

This would complement the new support for user defined sys.excepthook 
introduced in Python 3.10.

----------

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

Reply via email to