Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions spyder_kernels/customize/spyderpdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@

"""Spyder debugger."""

from __future__ import annotations

import ast
import bdb
import builtins
from contextlib import contextmanager
from collections import namedtuple
from functools import lru_cache
import logging
import os
import sys
import traceback
import threading
from collections import namedtuple
from functools import lru_cache
import typing

from IPython.core.autocall import ZMQExitAutocall
from IPython.core.debugger import Pdb as ipyPdb
Expand All @@ -27,10 +30,16 @@
from spyder_kernels.comms.commbase import stacksummary_to_json
from spyder_kernels.comms.frontendcomm import CommError, frontend_request
from spyder_kernels.customize.utils import (
path_is_library, capture_last_Expr, exec_encapsulate_locals
path_is_library,
capture_last_Expr,
exec_encapsulate_locals,
)


if typing.TYPE_CHECKING:
from spyder_kernels.console.shell import SpyderShell


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -85,7 +94,9 @@ def __init__(self, completekey='tab', stdin=None, stdout=None,
self._exclamation_warning_printed = False
self.pdb_stop_first_line = True
self._disable_next_stack_entry = False
super(SpyderPdb, self).__init__()
self.shell: SpyderShell | None = None

super().__init__()

# content of tuple: (filename, line number)
self._previous_step = None
Expand Down Expand Up @@ -248,11 +259,6 @@ def interrupt(self):
self.message("\nProgram interrupted. (Use 'cont' to resume).")
self.set_step()

def set_trace(self, frame=None):
"""Register that debugger is tracing."""
self.shell.add_pdb_session(self)
super(SpyderPdb, self).set_trace(frame)

def set_quit(self):
"""Register that debugger is not tracing."""
self.shell.remove_pdb_session(self)
Expand Down
Loading