Skip to content

prevent Pdb from setting a break point with the "step" command after the last line #1

Description

@TaiSakuma

If the Pdb command step is used after the last line of the script, Pdb will set the trace_dispath function as the trace function of the caller's frame. Consequently, the trace_dispath function will be called at line 48 after the script execution has finished.

https://github.com/simonsobs/nextline/blob/a0ed6aae1b7cc38f4648a7118408091d989e767f/nextline/main.py#L45-L49

The trace_dispath function is set in Bdb.set_trace()

https://github.com/python/cpython/blob/v3.9.5/Lib/bdb.py#L298-L308

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions