Skip to content

PY_THROW event can't be turned off for pdb's monitoring backend #132536

Closed
@gaogaotiantian

Description

@gaogaotiantian

Bug report

Bug description:

def gen():
    yield 1

def f():
    breakpoint()
    g = gen()
    try:
        g.throw(TypeError)
    except TypeError:
        pass  # line 10

f()
b 10
c
Traceback (most recent call last):
  File "/home/gaogaotiantian/programs/mycpython/scrabble.py", line 12, in <module>
    f()
    ~^^
  File "/home/gaogaotiantian/programs/mycpython/scrabble.py", line 8, in f
    g.throw(TypeError)
    ~~~~~~~^^^^^^^^^^^
  File "/home/gaogaotiantian/programs/mycpython/scrabble.py", line 1, in gen
    def gen():
ValueError: Cannot disable PY_THROW events. Callback removed.

PY_THROW can't be disabled.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions