Skip to content

Commit 9badd32

Browse files
authored
Merge pull request #75 from plasma-umass/fix-ipython9-compat
Add IPython 9 compatibility
2 parents be2e232 + 4363246 commit 9badd32

4 files changed

Lines changed: 19 additions & 14 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
code-quality:
1111
strategy:
1212
matrix:
13-
python: ["3.9","3.10", "3.11", "3.12", "3.13"]
13+
python: ["3.11", "3.12", "3.13"]
1414

1515
runs-on: ubuntu-latest
1616

.github/workflows/sanity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
platform: ["ubuntu-latest", "macos-latest", "windows-latest"]
14-
python: ["3.9","3.10", "3.11", "3.12", "3.13"]
14+
python: ["3.11", "3.12", "3.13"]
1515

1616
runs-on: ${{ matrix.platform }}
1717

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ dependencies = [
1818
"ansicolors>=1.1.8",
1919
"traitlets>=5.14.1",
2020
"ipdb>=0.13.13",
21-
"ipython==8.18.1",
21+
"ipython>=9.0.0",
22+
"pygments>=2.0.0",
2223
"litellm==1.55.9",
2324
"PyYAML>=6.0.1",
2425
"ipyflow>=0.0.130",
2526
"numpy>=1.26.3",
2627
]
2728
description = "AI-assisted debugging. Uses AI to answer 'why'."
2829
readme = "README.md"
29-
requires-python = ">=3.9"
30+
requires-python = ">=3.11"
3031
classifiers = [
3132
"Programming Language :: Python :: 3",
3233
"License :: OSI Approved :: Apache Software License",

src/chatdbg/chatdbg_pdb.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pathlib import Path
1313

1414
import IPython
15+
from pygments.token import Token
1516

1617
import pdb
1718

@@ -473,9 +474,7 @@ def _hidden_predicate(self, frame):
473474
return False
474475

475476
def print_stack_trace(self, context=None, locals=None):
476-
# override to print the skips into stdout instead of stderr...
477-
Colors = self.color_scheme_table.active_colors
478-
ColorsNormal = Colors.Normal
477+
# override to print the skips into stdout instead of stderr and to add locals
479478
if context is None:
480479
context = self.context
481480
try:
@@ -497,19 +496,24 @@ def print_stack_trace(self, context=None, locals=None):
497496
skipped += 1
498497
continue
499498
if skipped:
500-
print(
501-
f"{Colors.excName} [... skipping {skipped} hidden frame(s)]{ColorsNormal}\n",
502-
file=self.stdout,
499+
msg = self.theme.format(
500+
[
501+
(
502+
Token.ExcName,
503+
f" [... skipping {skipped} hidden frame(s)]",
504+
)
505+
]
503506
)
507+
print(f"{msg}\n", file=self.stdout)
504508
skipped = 0
505-
self.print_stack_entry(frame_lineno, context=context)
509+
self.print_stack_entry(frame_lineno)
506510
if locals:
507511
print_locals(self.stdout, frame_lineno[0])
508512
if skipped:
509-
print(
510-
f"{Colors.excName} [... skipping {skipped} hidden frame(s)]{ColorsNormal}\n",
511-
file=self.stdout,
513+
msg = self.theme.format(
514+
[(Token.ExcName, f" [... skipping {skipped} hidden frame(s)]")]
512515
)
516+
print(f"{msg}\n", file=self.stdout)
513517
except KeyboardInterrupt:
514518
pass
515519

0 commit comments

Comments
 (0)