Commit Graph

24 Commits

Author SHA1 Message Date
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
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 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
Tim Peters 480725d4c5 Whitespace normalization. 2006-04-03 02:46:44 +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
Walter Dörwald c85c74cd08 Increase code coverage in Python/structmember.c from 33% to 40%
(by forcing a call to the listmember() function).
2005-11-18 16:51:05 +00:00
Raymond Hettinger f7010bed89 * Bumped up the sleep() delay to four seconds so this test will run
reliably on WinME with FAT32.
* Native speaker rewrite of the comment block.
* Removed unnecessary backslashes from the multi-line function defintions.
2004-11-01 22:27:14 +00:00
Hye-Shik Chang 4a8d851910 Bug #1057993: Use sleep() always instead of os.utime() possibly broken
in some platforms.
2004-11-01 08:26:09 +00:00
Hye-Shik Chang 7afa64e260 Add a comment explains why we should modify mtime here. 2004-10-27 03:12:05 +00:00
Tim Peters 1816d79bac Removed newly redundant embedded import. 2004-10-27 02:44:10 +00:00
Tim Peters 10d59f3fa1 Whitespace normalization. 2004-10-27 02:43:25 +00:00
Tim Peters f1af9c0896 Paper over bug 1054615 by passing sane values to os.utime().
The underlying bug still exists, but also existed in 2.3.4:
import.c's load_source_module() returns NULL if
PyOS_GetLastModificationTime() returns -1, but
PyOS_GetLastModificationTime() doesn't set any exception when it returns
-1, and neither does load_source_module() when it gets back -1.  This
leads to "SystemError: NULL result without error in PyObject_Call"
on an import that fails in this way.
2004-10-27 02:33:15 +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
Finn Bock 57f0f3475e Skip the test_nocaret test when running as jython. Jython happens to add
a caret in this case too.
2002-11-06 11:45:15 +00:00
Barry Warsaw 408b6d34de Complete the absolute import patch for the test suite. All relative
imports of test modules now import from the test package.  Other
related oddities are also fixed (like DeprecationWarning filters that
weren't specifying the full import part, etc.).  Also did a general
code cleanup to remove all "from test.test_support import *"'s.  Other
from...import *'s weren't changed.
2002-07-30 23:27:12 +00:00
Barry Warsaw 04f357cffe Get rid of relative imports in all unittests. Now anything that
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".

This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).

Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Fred Drake 2e2be3760c Change the PyUnit-based tests to use the test_main() approach. This
allows using the tests with unittest.py as a script.  The tests will
still run when run as a script themselves.
2001-09-20 21:33:42 +00:00
Jeremy Hylton 3090694068 Fix compileall.py so that it fails on SyntaxErrors
The changes cause compilation failures in any file in the Python
installation lib directory to cause the install to fail.  It looks
like compileall.py intended to behave this way, but a change to
py_compile.py and a separate bug defeated it.

Fixes SF bug #412436

This change affects the test suite, which contains several files that
contain intentional errors.  The solution is to extend compileall.py
with the ability to skip compilation of selected files.

In the test suite, rename nocaret.py and test_future[3..7].py to start
with badsyntax_nocaret.py and badsyntax_future[3..7].py.  Update the
makefile to skip compilation of these files.  Update the tests to use
the name names for imports.

NB compileall.py is changed so that compile_dir() returns success only
if all recursive calls to compile_dir() also check success.
2001-04-18 01:19:28 +00:00
Tim Peters 7e01e284cb Whitespace normalization. 2001-04-08 07:44:07 +00:00
Jeremy Hylton 09ccc3a22a Test that traceback module works with SyntaxErrors with or without carets. 2001-03-21 20:33:04 +00:00