Skip to content

Commit

Permalink
fix _pdbcmd_print_frame_status
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Oct 4, 2024
1 parent 783a684 commit 525d9fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spyder_kernels/customize/spyderpdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,14 @@ def user_return(self, frame, return_value):

def _cmdloop(self):
"""Modifies the error text."""
# Interaction in python 3.12.? adds _pdbcmd_print_frame_status
# That we must patch if self.pdb_use_exclamation_mark
if (
self.pdb_use_exclamation_mark
and self.cmdqueue
and self.cmdqueue[-1] == '_pdbcmd_print_frame_status'
):
self.cmdqueue[-1] = '!_pdbcmd_print_frame_status'
self.interrupting = False
while True:
try:
Expand All @@ -623,6 +631,12 @@ def _cmdloop(self):
print("--KeyboardInterrupt--\n"
"For copying text while debugging, use Ctrl+Shift+C",
file=self.stdout)
if (
self.cmdqueue
and self.cmdqueue[-1] == '!_pdbcmd_print_frame_status'
):
# If !_pdbcmd_print_frame_status is not used, pop it out
self.cmdqueue.pop()

@lru_cache
def canonic(self, filename):
Expand Down

0 comments on commit 525d9fd

Please sign in to comment.