Skip to content

Commit 72ba3ef

Browse files
committed
dev-python/ipython: Backport upstream fix for python 3.13 regression
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <[email protected]>
1 parent 8976748 commit 72ba3ef

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FAILED IPython/core/tests/test_run.py::TestMagicRunPass::test_run_debug_twice - AttributeError: 'Pdb' object has no attribute 'curframe'. Did you mean: 'botframe'?
2+
FAILED IPython/core/tests/test_run.py::TestMagicRunPass::test_run_debug_twice_with_breakpoint - AttributeError: 'Pdb' object has no attribute 'curframe'. Did you mean: 'botframe'?
3+
https://bugs.gentoo.org/946568
4+
https://github.com/ipython/ipython/pull/14598
5+
https://github.com/ipython/ipython/commit/c1e945b5bc8fb673109cf32c4f238f6d5e0f5149.patch
6+
7+
From c1e945b5bc8fb673109cf32c4f238f6d5e0f5149 Mon Sep 17 00:00:00 2001
8+
From: M Bussonnier <[email protected]>
9+
Date: Sun, 8 Dec 2024 11:37:11 +0100
10+
Subject: [PATCH] Fix pdb issues in Python 3.13.1
11+
12+
For some reason it is not always set, it was/is a bug in IPython to not
13+
check.
14+
---
15+
IPython/core/debugger.py | 2 +-
16+
1 file changed, 1 insertion(+), 1 deletion(-)
17+
18+
diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py
19+
index 1f0d7b2fba..76c42e0230 100644
20+
--- a/IPython/core/debugger.py
21+
+++ b/IPython/core/debugger.py
22+
@@ -550,7 +550,7 @@ def _get_frame_locals(self, frame):
23+
So if frame is self.current_frame we instead return self.curframe_locals
24+
25+
"""
26+
- if frame is self.curframe:
27+
+ if frame is getattr(self, "curframe", None):
28+
return self.curframe_locals
29+
else:
30+
return frame.f_locals

dev-python/ipython/ipython-8.30.0.ebuild renamed to dev-python/ipython/ipython-8.30.0-r1.ebuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ PDEPEND="
8181
)
8282
"
8383

84+
PATCHES=( "${FILESDIR}"/${P}-python3.13-debugger-pdb-curframe.patch ) # bug #946568
85+
8486
python_prepare_all() {
8587
# Rename the test directory to reduce sys.path pollution
8688
# https://github.com/ipython/ipython/issues/12892

0 commit comments

Comments
 (0)