1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-07 04:53:37 -04:00
elinks/src/scripting/python
M. Levinson a229adb19a A more nuanced approach to Python warnings.
By default some Python warning messages would be written to standard error
by the interpreter. To prevent these warnings from making a mess of the
ELinks screen, all warnings were turned into exceptions so they could be
caught and displayed through the usual report_scripting_error() mechanism.

With Python 3.2, this approach backfires: A new class of ResourceWarnings
that are filtered by default (and hence would *not* have been written to
standard error) are now turned into exceptions, and these exceptions can't
be caught because they're emitted from the interpreter's cleanup code. As
a result, the uncaught exceptions would make a mess of the ELinks screen.

The new solution is to replace Python's standard library function
warnings.showwarning() with one that turns warning messages into exceptions.
This means we'll wait until a warning would have been written to standard
error before turning it into an exception, so other warnings that would
never have reached that point because they're filtered will remain unseen.

(The behavior of warning messages is described in the documentation for
the "warnings" module from Python's standard library.)
2013-07-05 12:29:58 +02:00
..
core.c A more nuanced approach to Python warnings. 2013-07-05 12:29:58 +02:00
core.h Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
dialogs.c Cast variadic arguments of getml to void *. 2007-03-11 12:41:17 +02:00
dialogs.h
document.c
document.h
hooks.c Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
hooks.h
keybinding.c
keybinding.h
load.c
load.h
Makefile
menu.c Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
menu.h
open.c
open.h
python.c Mark all module names for translation and include needed header files. 2007-03-21 11:01:06 +01:00
python.h