mirror of
https://github.com/python/cpython.git
synced 2024-11-28 08:20:55 +01:00
9f1b9932b8
raised by the compiler. XXX For now, text entered into the interactive intepreter is not printed in the traceback. Inspired by a patch from Roman Sulzhyk compile.c: Add helper fetch_program_text() that opens a file and reads until it finds the specified line number. The code is a near duplicate of similar code in traceback.c. Modify com_error() to pass two arguments to SyntaxError constructor, where the second argument contains the offending text when possible. Modify set_error_location(), now used only by the symtable pass, to set the text attribute on existing exceptions. pythonrun.c: Change parse_syntax_error() to continue of the offset attribute of a SyntaxError is None. In this case, it sets offset to -1. Move code from PyErr_PrintEx() into helper function print_error_text(). In the helper, only print the caret for a SyntaxError if offset > 0. |
||
---|---|---|
.. | ||
.cvsignore | ||
atof.c | ||
bltinmodule.c | ||
ceval.c | ||
codecs.c | ||
compile.c | ||
dup2.c | ||
dynload_aix.c | ||
dynload_beos.c | ||
dynload_dl.c | ||
dynload_hpux.c | ||
dynload_mac.c | ||
dynload_next.c | ||
dynload_os2.c | ||
dynload_shlib.c | ||
dynload_stub.c | ||
dynload_win.c | ||
errors.c | ||
exceptions.c | ||
fmod.c | ||
frozen.c | ||
frozenmain.c | ||
future.c | ||
getargs.c | ||
getcompiler.c | ||
getcopyright.c | ||
getcwd.c | ||
getmtime.c | ||
getopt.c | ||
getplatform.c | ||
getversion.c | ||
graminit.c | ||
hypot.c | ||
import.c | ||
importdl.c | ||
importdl.h | ||
marshal.c | ||
memmove.c | ||
modsupport.c | ||
mystrtoul.c | ||
pyfpe.c | ||
pystate.c | ||
pythonmain.c | ||
pythonrun.c | ||
sigcheck.c | ||
strdup.c | ||
strerror.c | ||
strtod.c | ||
structmember.c | ||
symtable.c | ||
sysmodule.c | ||
thread_beos.h | ||
thread_cthread.h | ||
thread_foobar.h | ||
thread_lwp.h | ||
thread_nt.h | ||
thread_os2.h | ||
thread_pth.h | ||
thread_pthread.h | ||
thread_sgi.h | ||
thread_solaris.h | ||
thread_wince.h | ||
thread.c | ||
traceback.c |