[Python-checkins] python/dist/src/Doc/lib libpycompile.tex,1.3,1.4
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Wed, 15 Jan 2003 03:51:08 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv4597/Doc/lib
Modified Files:
libpycompile.tex
Log Message:
Patch #661719: Expose compilation errors as exceptions on request.
Index: libpycompile.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpycompile.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** libpycompile.tex 21 Aug 2002 20:56:21 -0000 1.3
--- libpycompile.tex 15 Jan 2003 11:51:06 -0000 1.4
***************
*** 20,25 ****
containing the source code.
! \begin{funcdesc}{compile}{file\optional{, cfile\optional{, dfile}}}
Compile a source file to byte-code and write out the byte-code cache
file. The source code is loaded from the file name \var{file}. The
--- 20,28 ----
containing the source code.
+ \begin{excdesc}{PyCompileError}
+ Exception raised when an error occurs while attempting to compile the file.
+ \end{excdesc}
! \begin{funcdesc}{compile}{file\optional{, cfile\optional{, dfile\optional{, doraise}}}}
Compile a source file to byte-code and write out the byte-code cache
file. The source code is loaded from the file name \var{file}. The
***************
*** 28,33 ****
current interpreter). If \var{dfile} is specified, it is used as
the name of the source file in error messages instead of \var{file}.
\end{funcdesc}
-
\begin{funcdesc}{main}{\optional{args}}
--- 31,38 ----
current interpreter). If \var{dfile} is specified, it is used as
the name of the source file in error messages instead of \var{file}.
+ If \var{doraise} = True, a PyCompileError is raised when an error is
+ encountered while compiling \var{file}. If \var{doraise} = False (the default),
+ an error string is written to sys.stderr, but no exception is raised.
\end{funcdesc}
\begin{funcdesc}{main}{\optional{args}}