kann sys.excepthook nicht überschreiben

Ich versuche das Verhalten von anzupassensys.excepthook wie beschrieben vondas Rezept.

in ipython:

:import pdb, sys, traceback
:def info(type, value, tb):
:    traceback.print_exception(type, value, tb)
:    pdb.pm()
:sys.excepthook = info
:--
>>> x[10] = 5
-------------------------------------------------
Traceback (most recent call last):
  File "<ipython console>", line 1, in <module>
NameError: name 'x' is not defined
>>>

pdb.pm() wird nicht angerufen. Es scheint, dasssys.excepthook = info funktioniert in meiner Python 2.5-Installation nicht.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage