55 Commits

Author SHA1 Message Date
Florent Xicluna
edfd9addf6 Issue #17825: Cursor ^ is correctly positioned for SyntaxError and IndentationError. 2014-01-22 01:33:59 +01:00
Georg Brandl
e206e49172 Closes #16657: fix docstring of traceback.format_tb(). 2013-10-13 23:31:38 +02:00
Andrew Svetlov
4bb142b1b7 Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:27:37 +02:00
Victor Stinner
926fd4ee32 Issue #8313: traceback.format_exception_only() encodes unicode message to
ASCII with backslashreplace error handler if str(value) failed
2010-05-05 12:40:49 +00:00
Georg Brandl
eb56aa169a #3584: ignore trailing newlines when placing the caret for a SyntaxError location. 2009-06-04 09:15:12 +00:00
Georg Brandl
dc4a77159b #1326077: fix traceback formatting of SyntaxErrors. This fixes two differences with formatting coming from Python: a) the reproduction of location details in the error message if no line text is given, b) the prefixing of the last line by one space. 2009-04-05 14:24:52 +00:00
Benjamin Peterson
797eaf305a complain when there's no last exception 2009-03-23 21:25:15 +00:00
Benjamin Peterson
3e6c335ae0 revert r70552; wrong fix 2009-03-23 21:23:30 +00:00
Benjamin Peterson
85e1478ca4 fix very old names for exception terms #5543 2009-03-23 20:47:59 +00:00
Brett Cannon
5400b6b2e2 Fix a DeprecationWarning about __getitem__() and exceptions in the 'traceback' module. 2008-08-01 01:21:50 +00:00
Georg Brandl
c7986cee76 Fix a bug in traceback.format_exception_only() that led to an error
being raised when print_exc() was called without an exception set.
In version 2.4, this printed "None", restored that behavior.
2006-09-24 12:50:24 +00:00
Georg Brandl
16183631ed Better fix for bug #1531405, not executing str(value) twice. 2006-08-04 18:07:34 +00:00
Neal Norwitz
ff4b63b80f Bug #1531405, format_exception no longer raises an exception if
str(exception) raised an exception.
2006-08-04 04:50:21 +00:00
Tim Peters
0bbfd83250 Whitespace normalization. 2006-07-24 21:02:15 +00:00
Georg Brandl
afb44f47d9 Repair accidental NameError. 2006-07-24 20:11:35 +00:00
Georg Brandl
c13c34c39d Patch #1515343: Fix printing of deprecated string exceptions with a
value in the traceback module.
2006-07-24 14:09:56 +00:00
Guido van Rossum
8f6cbe1502 Fix the formatting of KeyboardInterrupt -- a bad issubclass() call. 2006-05-02 17:36:09 +00:00
Anthony Baxter
57fdcbc60f reverting r45321: Patch #860326: traceback.format_exception_only() now
prepends the exception's module name to non-builtin exceptions, like
the interpreter itself does.

broke a number of doctests. should be discussed before checking in (see
discussion on python-dev).
2006-04-13 01:34:33 +00:00
Georg Brandl
24c274f5dc Patch #860326: traceback.format_exception_only() now prepends the
exception's module name to non-builtin exceptions, like the interpreter
itself does.
2006-04-12 21:14:09 +00:00
Phillip J. Eby
4703211080 Updated the warnings, linecache, inspect, traceback, site, and doctest modules
to work correctly with modules imported from zipfiles or via other PEP 302
__loader__ objects.  Tests and doc updates are included.
2006-04-11 01:07:43 +00:00
Georg Brandl
51dbc4c879 traceback now shows error position for all SyntaxError subclasses,
e.g. IndentationError. (bug #1447885)
2006-03-31 15:59:13 +00:00
Phillip J. Eby
4a26633e0e Revert r42719, because the isinstance() check wasn't redundant; formatting a
string exception was causing a TypeError.
2006-03-24 22:10:54 +00:00
Thomas Wouters
7c187bcc82 Remove redundant isinstance() check. 2006-03-01 05:34:22 +00:00
Brett Cannon
bf36409e2a PEP 352 implementation. Creates a new base class, BaseException, which has an
added message attribute compared to the previous version of Exception.  It is
also a new-style class, making all exceptions now new-style.  KeyboardInterrupt
and SystemExit inherit from BaseException directly.  String exceptions now
raise DeprecationWarning.

Applies patch 1104669, and closes bugs 1012952 and 518846.
2006-03-01 04:25:17 +00:00
Hye-Shik Chang
182ac85147 SF #737473: Show up-to-date source code in tracebacks always.
And add an optional argument 'filename' to linecache.checkcache()
to enable checking caches per-file.
2004-10-26 09:16:42 +00:00