◐ Shell
clean mode source ↗

gh-106670: Fix Pdb handling of chained Exceptions with no stacks. by Carreau · Pull Request #108865 · python/cpython

The introduction of chained exception in pythongh-106676 would sometime lead to

    File .../Lib/pdb.py", line 298, in setup
      self.curframe = self.stack[self.curindex][0]
                    ~~~~~~~~~~^^^^^^^^^^^^^^^
    IndexError: list index out of range

This fixes that by filtering exceptions that that do not have a
stack/traceback. Update tests to not use stack-less exceptions when
testing another feature, and add an explicit test on how we handle
stackless exceptions.

iritkatriel

Carreau

@Carreau

iritkatriel

iritkatriel

@Carreau

@Carreau

@Carreau

Carreau

@Carreau

Carreau

iritkatriel

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
… the next previous one with tb

iritkatriel

Carreau

iritkatriel