Search code examples
pythonipythonpdb

NoneType error when trying to use pdb via FormmatedTB


When executing the following code:

from IPython.core import ultratb
sys.excepthook = ultratb.FormattedTB(mode='Verbose', color_scheme='Linux', call_pdb=1)

In order to catch exceptions, I receive the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dinari/miniconda3/envs/testenv/lib/python3.8/site-packages/IPython/core/ultratb.py", line 994, in __init__
    VerboseTB.__init__(self, color_scheme=color_scheme, call_pdb=call_pdb,
  File "/Users/dinari/miniconda3/envs/testenv/lib/python3.8/site-packages/IPython/core/ultratb.py", line 638, in __init__
    TBTools.__init__(
  File "/Users/dinari/miniconda3/envs/testenv/lib/python3.8/site-packages/IPython/core/ultratb.py", line 242, in __init__
    self.pdb = debugger_cls()
TypeError: 'NoneType' object is not callable

Using python 3.8.2 and IPython 8.4.0

pdb otherwise is working fine.

Any idea for a fix for this?


Solution

  • Downgrading IPython to 7.34.0 solved this.