Terry J. Reedy added the comment:
I believe startup files are compiled in PyShell.py, line 649 (3.x)
try:
code = compile(source, filename, "exec")
except (OverflowError, SyntaxError):
and editor code is compiled in ScriptBinding.py, line 100
try:
# If successful, return the compiled code
return compile(source, filename, "exec")
except (SyntaxError, OverflowError, ValueError) as value:
Adding SystemError to the tuple is trivial. I just need to test to verify.
(Side note: I think the tuple should be the same for both. The reasons for
entries other than SyntaxError should be documented. ValueError when
compiling?)
I believe that interactive input is forwarded to stdlib
code.InteractiveInterpreter in PyShell.py, line 679
try:
# InteractiveInterpreter.runsource() calls its runcode() method,
# which is overridden (see below)
return InteractiveInterpreter.runsource(self, source, filename)
The compile call and error catching is inside Lib/code.py, line 57.
try:
code = self.compile(source, filename, symbol)
except (OverflowError, SyntaxError, ValueError):
It should be fixed here.
----------
nosy: +terry.reedy
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25733>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com