33 Commits

Author SHA1 Message Date
Anthony Baxter
c2b1cda86c reverting r45322 - "traceback.format_exception_only() now prepends
the exception's module name to non-builtin exceptions, like the
interpreter itself does."

Reverting because:
A - broke tests
B - changed behaviour of 2.4.
2006-04-13 01:29:10 +00:00
Georg Brandl
e5a7968780 Patch #860326: traceback.format_exception_only() now prepends the
exception's module name to non-builtin exceptions, like the interpreter
itself does.
 (backport from rev. 45321)
2006-04-12 21:14:12 +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
Tim Peters
58eb11cf62 Whitespace normalization. 2004-01-18 20:29:55 +00:00
Neil Schemenauer
f607fc5395 Add traceback.format_exc(). 2003-11-05 23:03:00 +00:00
Michael W. Hudson
dd32a91cc0 This is my patch
[ 587993 ] SET_LINENO killer

Remove SET_LINENO.  Tracing is now supported by inspecting co_lnotab.

Many sundry changes to document and adapt to this change.
2002-08-15 14:59:02 +00:00
Raymond Hettinger
10ff706e27 Replaced boolean tests with is None. 2002-06-02 03:04:52 +00:00
Tim Peters
0bb580d297 SF bug 431772: traceback.print_exc() causes traceback
Patch from Michael Hundson.
format_exception_only() blew up when trying to report a SyntaxError
from a string input (line is None in this case, but it assumed a string).
Bugfix candidate.
2001-06-10 18:58:26 +00:00
Tim Peters
a19a168ccc Whitespace normalization. 2001-03-29 04:36:09 +00:00
Jeremy Hylton
ed9d0ba482 Do not print caret when offset is None. 2001-03-21 20:29:18 +00:00
Jeremy Hylton
69e9e8bd51 Reformat and edit docstrings to follow modern conventions. Single
line summary followed by blank line and description.
2001-03-21 19:09:31 +00:00
Skip Montanaro
40fc16059f final round of __all__ lists (I hope) - skipped urllib2 because Moshe may be
giving it a slight facelift
2001-03-01 04:27:19 +00:00
Eric S. Raymond
6e025bcde8 String method cleanup. 2001-02-10 00:22:33 +00:00
Eric S. Raymond
ec3bbdef94 String method conversion. 2001-02-09 09:39:08 +00:00
Tim Peters
b90f89a496 Whitespace normalization. 2001-01-15 03:26:36 +00:00
Guido van Rossum
3ad167ae34 mwh: [ Patch #103228 ] traceback.py nit.
When the exception has no message, don't insert a colon after the
exception name.
2001-01-13 22:14:31 +00:00
Guido van Rossum
2823f03a56 Patch by Toby Dickenson: don't die when an error occurs during string
conversion in an exception, but instead display <unprintable %s
object> where %s is the type name.
2000-08-22 02:04:46 +00:00
Thomas Wouters
7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Guido van Rossum
3bb1edb328 Match the error messages to say "(most recent call last)" like the
built-in messages.
2000-04-10 16:29:29 +00:00
Guido van Rossum
e7b146fb3b The third and final doc-string sweep by Ka-Ping Yee.
The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.

A new docstring was added to formatter.  The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
2000-02-04 15:28:42 +00:00
Guido van Rossum
3f0666c4a2 Add obvious needed else clause to format_exception(). 1998-03-18 17:48:06 +00:00
Guido van Rossum
6e73af723c New version of tb_lineno(), this time *not* using try-except, to avoid
disturbing the current exception, and returning tb.tb_lineno, which is
the line number of thr traceback, rather than the current line number.
By Jim Hugunin.
1998-02-26 17:25:02 +00:00
Guido van Rossum
7266496b00 Tweak the tb_lineno() function to be compatible with JPython, which
has no line number table etc.
1998-02-25 16:33:39 +00:00
Guido van Rossum
4752966193 Use Marc Lemburg's tb_lineno() to calculate the correct line number.
Apparently the traceback object doesn't contains the right linenumber
when -O is used.  Rather than guessing whether -O is on or off, use
tb_lineno() unconditionally.
1997-09-26 22:43:02 +00:00
Guido van Rossum
2deb73a961 Use sys.exc_info() instead of sys.exc_{type,value,traceback}.
Also corrected a typo in format_stack (t should've been f).
1997-07-18 16:46:36 +00:00